aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: hibernate: table per concrete class implicit polimorphism
 
Similar Threads
Legacy and Hibernate1-2-M Mapping
polymormsim related demos
WrongClassException: Object with id:1 was not of the specified subclass
Hibernate: Collection Mapping on Non-Primary Key
Hibernate - Mapping foreign keys tables