wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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: 314
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
 
Consider Paul's rocket mass heater.
 
subject: hibernate: table per concrete class implicit polimorphism
 
Similar Threads
Hibernate: Collection Mapping on Non-Primary Key
WrongClassException: Object with id:1 was not of the specified subclass
Legacy and Hibernate1-2-M Mapping
Hibernate - Mapping foreign keys tables
polymormsim related demos