Re: DataObject constructor from two other DataObjects

From: Mike Kienenberger (mkienen..mail.com)
Date: Fri Dec 02 2005 - 12:21:01 EST

  • Next message: Cris Daniluk: "Re: DataObject constructor from two other DataObjects"

    Student student = new Student(onepeople, oneschool);

    ....but I only know the standard DataObject constructor:

    // This is psuedo-code
    Student student =
    (Student)dataContext.createAndRegisterNewObject(Student.class);
    student.setSchool(oneSchool);
    student.setPeople(onePeople);

    On 12/2/05, Andrea Borgogelli Avveduti <borgogell..otmail.com> wrote:
    >
    > Hi boys,
    >
    > in my example the ER schema has 3 tables:
    >
    > 1) People (PK is a code like social security number: varchar(20))
    > 2) Schools (PK is a counter)
    > 3) Students (PK is people's social number and school's ID)
    >
    > ObjectOriented options:
    >
    > 1) I can modelling the Student class with multiple-inheritance from People
    > and Schools class
    > 2) I can modelling the Student class as stand alone class with some
    > relations with the others two.
    >
    > The questione is:
    >
    > I have choose the second OO architectural option. So, how can I create an
    > istance of Student from an istance o People and School.
    >
    > I'd like to write a method like this:
    >
    > Student student = new Student(onepeople, oneschool);
    >
    > ....but I only know the standard DataObject constructor:
    >
    > dataContext.createAndRegisterNewObject(ObjEntity.class)
    >
    > Any advices ?
    >
    > Thank u to all of u
    >
    > Ciao
    >
    > Andrea



    This archive was generated by hypermail 2.0.0 : Fri Dec 02 2005 - 12:21:02 EST