• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Table-per-class mapping restrictions

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
Table-per-class inheritance mapping with JPA doesn't allow the usage of AUTO and IDENTITY for ID generation.
Would you please shed more light on this restriction?
Why SEQUENCE is allowed?
Thanks.
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With this strategy, the generated ID values must be unique over all the tables used for the inheritance hierarchy. A sequence can do this nicely;
apparently, the other methods can't.
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is exactly what I don't understand...
Suppose I have two tables:
FancyTable and AmazingTable, each table has ID column.
If ID column of FancyTable contains values (1, 3, 7), this means ID column of Amazing table can't hold values (1, 3, 7)?
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, if they are mapped within the same hierarchy.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic