I have a similar problem like this SO question. But my application is running on MySQL with working data.
What is the best practice to refactor the application with an existing database which is populated with data?
I have a similar problem like this SO question. But my application is running on MySQL with working data.
What is the best practice to refactor the application with an existing database which is populated with data?
Neither the TABLE_PER_CLASS
inheritance strategy nor the TABLE
generator scale very well.
The TABLE
generator uses [row-level locks and a separate transaction][2] every time it needs to fetch a new identifier value. That puts pressure on the connection pool since you need two connections whenever you try to insert an entity.
The TABLE_PER_CLASS
inheritance strategy generates suboptimal queries when using polymorphic JPQL. Use SINGLE_TABLE
or JOINED
instead.