• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inserting into different tables thru hibernate ??????

 
Deepak Kumar Sermoria
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi please help how to save data into different tables using hibernate at atime,say a person registers into site i want his personal info into one table ,his work info into some other table and contact info into some other info
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just save the objects that map to those tables. If the data is related you can cascade some or all of the inserts depending on how you've mapped your associations.
 
Deepak Kumar Sermoria
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul

but i want to use single pojo object with all the fields of those tables....
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK - not sure I would model this as one type, but its your call. You'll need to use the join mapping.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic