Stuck in Java
Stuck in Java

Reputation: 202

Working with Duplicate Rows Hibernate

We have DB with duplicate rows(with duplicate primary key) and we need to handle it in hibernate , is there a way that in HBM itself this can be handled, may be using distinct or some other way, we also have lots of joins on those table.

Thank you

Upvotes: 0

Views: 496

Answers (1)

Egor Lyashenko
Egor Lyashenko

Reputation: 797

Hibernate requires that entity table have primary key which should be unique. Try to change your table schema by adding unique column and make this column your new primary key.

Upvotes: 0

Related Questions