About Inheritance

6 views
Skip to first unread message

mayel.su

unread,
May 4, 2013, 3:38:55 PM5/4/13
to Siena
Good Morning! . I'm new on Siena. I have a dude. If I have two
entities: Person and Employer, and then: Employer extend Person

After I want to insert in my db an object of Employer,
Person e= new Employer(a,b,c,d);
eb.insert();

With this it would have to insert automatically a Person too? or I´d
have to do an insert for a Perso...

A summary of my code is:
Constructor of Employer:

public Employer(String a, String b, String c, String d) {
super(a,b);
this.c = c;
this.d = d;
}

The constructor of Person is:

public Person(String a, String b) {
super();
}
Thanks
Reply all
Reply to author
Forward
0 new messages