This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes hibernate:  table per concrete class  implicit polimorphism Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "hibernate:  table per concrete class  implicit polimorphism" Watch "hibernate:  table per concrete class  implicit polimorphism" New topic
Author

hibernate: table per concrete class implicit polimorphism

peter cooke
Ranch Hand

Joined: Mar 16, 2004
Posts: 317
thanks to anyone helping me to learn.

I have an unusual mapping that I am trying to figure out how to do.
for lack of being allowed to give a more accurate example to my programming task.

I have 4 tables of lets say car, stereo, transmission, assembly_details

a car has a stero (zero or 1), a transmission, and zero or more assembly_details

a stereo has an asembly_details (1-to-1)

a transmission has an assembly_details. (1-to-1)

An assembly_details record may have one or more sub_assembly_details,
and a reference to it's parent either a car/stereo/transmission/assembly_details.


In Hibernate how do I say that assembly_details parent is either a car, a stereo, transmission, or assembly_details???

Is the proper solution to use "Table per concrete class using implicit polymorphism"


CIAO Peter M. Cooke
 
Don't get me started about those stupid light bulbs.
 
subject: hibernate: table per concrete class implicit polimorphism