• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Legacy inheritance mapping and Hibernate

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I'm trying to replace an old persistence layer with Hibernate. A rather uncommon inheritance mapping is in use, I hope this example helps to clarify:



Looking at the mapping options in Hibernate, on first sight it seems to resemble "Table per subclass". But this strategy lacks a certain speciality I tried to show in the example: The property values for all classes are stored in the "leaf class table" with the exception of references, which are stored in the class table where they occur.

I haven't found any information on how to map this with Hibernate. I guess that it might not be possible, but who knows? If it is not possible, do you think there is some way to trick Hibernate into believing that there is a "normal" inheritance mapping?

[ EDIT: Confused thoughts deleted. ]
[ April 19, 2008: Message edited by: Peter Merker ]
 
Peter Merker
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I corrected the image. The only concrete classes in the inheritance tree are the "leaf classes".
[ April 18, 2008: Message edited by: Peter Merker ]
reply
    Bookmark Topic Watch Topic
  • New Topic