1

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?

Community
  • 1
  • 1
Raymond
  • 885
  • 10
  • 28

1 Answers1

0

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.

Vlad Mihalcea
  • 142,745
  • 71
  • 566
  • 911