Hibernate version: 2.6
I have problem in saving the sub - class data
I have one Object Person and Other object Teacher which extends Person.
Person { id Long name String Role String (default values TEACHER,STUDENT) }
Teacher extends Person { subject - String }
TABLES
PERSON: ID NAME ROLE TEACHER : ID (Foreign Key to PERSON), SUBJECT
Based on Role I have to Save the Teacher Info
For Example
A ROW has following data in PERSON TABLE
1 ABC NULL
Now I am Updating the Role as TEACHER in PERSON Table while updating the PERSON Table a new has to be generated with same ID in TEACHER table. But My ID Generate class is identity in person mapping xml file
can any one please help me on this
|