Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mapping Inheritance - What is a UNION Join in hibernate or SQL ?

 
Ali Gordon
Ranch Hand
Posts: 182
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Chapter 16, page 311, the book "Hibernate Made Easy" by Cameron McKenzie says that -


In the JOINED inheritance type, tables only maintain data that map directly to the properties in the associated class. Subclasses are then linked to their
inherited properties through common primary key fields in the tables, linking as UNION joins at runtime.


What is the query for this UNION join in, say SQL server ?

To make the sample SQL query, take the example - Parent Class table {id, lastName}, Child Class table{id, firstName}
Here id, is the auto generated id made by hibernate. lastName and firstName are private Strings in their respective classes.

Thanks.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think he means you do a union of two (or more queries) that have joins in them. (not sure though)

For example,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic