my dog learned polymorphism*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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.
 
Consider Paul's rocket mass heater.
 
subject: Mapping in Hibernate for nested Bean Structure