File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Mapping in Hibernate for nested Bean Structure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Mapping in Hibernate for nested Bean Structure" Watch "Mapping in Hibernate for nested Bean Structure" New topic
Author

Mapping in Hibernate for nested Bean Structure

Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

Hi All,

I have a bean, which in-turn have one more bean in it. I am showing my mapping for parent bean in Hibernate. But I am not sure how to create a mapping for nested bean element.



And nested class Event is


Now here is my mapping for Person class.
If I had not Event in Person class the below mapping would have been perfect for Person class individually.


Now here is my problem, If I want to map modified Person bean(which have Event variable in it), how do I map this class for hibernate??

Please let me know, if anything is no clearly mentioned.


The Best way to predict your future is to create it - Every great individual common man
Edvins Reisons
Ranch Hand

Joined: Dec 11, 2006
Posts: 364
It is called a "one-to-one association", with an example here.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mapping in Hibernate for nested Bean Structure
 
Similar Threads
Question on Unidirectional Association
inverse=true in many-to-many doubt
Read/Write BLOB in byte[] with Hibernate in MySQL..
Object filtering in Hibernate from Database
Mapping Exception