6

Could somebody explain why InheritanceType.TABLE_PER_CLASS could not use the GenerationType.AUTO strategy for primary key value generation when mapping inheritance?

skip
  • 12,193
  • 32
  • 113
  • 153
  • GenerationType.AUTO is used when the db table has its own auto generation of ids e.g. AUTO_INCREMENT . This may not work in the the TABLE_PER_CLASS scenario as you would have collisions between each of the independently generated ids and so could not guarantee a unique id for any entity instance within the hierarchy – diarmuid Aug 26 '19 at 15:50

0 Answers0