• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mapping inheritance with annotation

 
David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know hibernate has 3 strats for inheritance :
1. Single table
2. table per class
3. joined

my questions are:
1. I also heard about table per concrete class and table per subclass. what are these two new strategies?
2. in table per class, does the abstract class also get a table? if so, does that mean that somehow the children class tables must have a FK pointing to parent table? I also noticed in hibernate docs that this strat needs union. how is that possible? union demands all union member to have same number and type of cols, but most likely Car and Airplane won't have same number and type of columns even if they're both Vehicles. then again, if they have the same columns and type, they would effectively inherit single table's weakness. this is very baffling
3. what's the difference between joined and table per class? after all, they both must do table joining
4. also, I'm doing this mapping with annotation. is there any thing that xml mapping can do but annotation mapping cannot achieve? or do all capabilities of XML mapping have been completely translated to their annotation counterpart?

thanks.
 
Amritendu De
author
Ranch Hand
Posts: 188
11
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Watch out for my new book which will clear all your doubts. The probable release date is April-May this year.

You can see the index here: http://www.coderanch.com/t/622592/books/book-Java-Spring-Hibernate-Data
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic