This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Inheritence in JPA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Inheritence in JPA" Watch "Inheritence in JPA" New topic

Inheritence in JPA

Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 224
Q1) I am confused with names? By how many names each one reffered?

1) Table per class hierarchy or Single table or Single Table Inheritance // Are these names are correct?Do they mean the same thing?
Data is store in one table.
lot of null able columns

2) Table per Subclass or Joined Inheritance
parent child relationship is established
No null able column

3) Table per class or table per concrete class

Each class has its own table
Parent fields get duplicated in table
Data gets repeated again and again

James Sutherland
Ranch Hand

Joined: Oct 01, 2007
Posts: 553
Sounds about right.

For #3, no data is duplicated, only columns. Each instance is only stored in one of the tables.

TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
I agree. Here's the link:
subject: Inheritence in JPA
It's not a secret anymore!