tables and class

Discussion in 'Java' started by Claudio Penasio Junior, Dec 28, 2003.

  1. Hello all...


    I have the follow data model
    Tables: Project and Task
    The Task table represent the any tasks of Project. This in a Database is so simple:

    ------------ -------------
    |Project | | Task |
    |----------| |-----------|
    |cod_proj |----------| cod_proj |
    |name_proj | | cod_task |
    |... | | descript |
    ------------ | .... |
    -------------
    how can i do it whith classes?

    Thanks ...
     
    Claudio Penasio Junior, Dec 28, 2003
    #1
    1. Advertising

  2. Claudio Penasio Junior

    Ryan Stewart Guest

    "Claudio Penasio Junior" <> wrote in message
    news:...
    > Hello all...
    >
    >
    > I have the follow data model
    > Tables: Project and Task
    > The Task table represent the any tasks of Project. This in a Database is

    so simple:
    >
    > ------------ -------------
    > |Project | | Task |
    > |----------| |-----------|
    > |cod_proj |----------| cod_proj |
    > |name_proj | | cod_task |
    > |... | | descript |
    > ------------ | .... |
    > -------------
    > how can i do it whith classes?
    >
    > Thanks ...


    Seems to me that should be a many to many relationship, but if that works
    for you then okay. Your object model would go something like this:

    public class Project {
    String name;
    // Other stuff
    Vector tasks;
    }

    public class Task {
    String description;
    // Other stuff
    Project project;
    }
     
    Ryan Stewart, Dec 28, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. E11
    Replies:
    1
    Views:
    4,948
    Thomas Weidenfeller
    Oct 12, 2005
  2. Peter Bassett
    Replies:
    3
    Views:
    970
    Augustus
    Aug 15, 2003
  3. Otuatail

    Tables within tables

    Otuatail, Jul 31, 2004, in forum: HTML
    Replies:
    7
    Views:
    522
  4. christopher diggins
    Replies:
    16
    Views:
    789
    Pete Becker
    May 4, 2005
  5. Chris Brat
    Replies:
    5
    Views:
    726
    =?iso-8859-1?q?Luis_M._Gonz=E1lez?=
    Aug 22, 2006
Loading...

Share This Page