Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mapping in Hibernate for nested Bean Structure

 
Shaan Shar
Ranch Hand
Posts: 1249
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Edvins Reisons
Ranch Hand
Posts: 364
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is called a "one-to-one association", with an example here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic