-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Save or Update
PostPosted: Sat Mar 05, 2005 3:05 am 
Newbie

Joined: Fri Dec 24, 2004 2:02 am
Posts: 4
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 08, 2005 8:56 am 
Newbie

Joined: Wed Feb 23, 2005 9:00 am
Posts: 8
use ID Generate class as assigned in person mapping xml file


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.