This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to map entity from inheritance hierarchy to property in another entity?

 
Volodymyr Lysenko
Ranch Hand
Posts: 511
1
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

I have entity hierarchy with inheriatnce type SINGLE_TABLE :
The problem is how to map this JuniorUser entity and all its subclasses as property in Answer entity as :

Thank you!
 
James Sutherland
Ranch Hand
Posts: 553
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to do anything special, just map it the same way you map any relationship. You can use @OneToOne or @ManyToOne.

http://en.wikibooks.org/wiki/Java_Persistence/Inheritance
 
Volodymyr Lysenko
Ranch Hand
Posts: 511
1
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank yoy for reply!

You don't need to do anything special, just map it the same way you map any relationship. You can use @OneToOne or @ManyToOne.

This is true!!!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic