Languages

JPA / Hibernate - returns duplicated rows

4 points
Asked by:
halfera
411

I have an issue: Hibernate returns duplicated rows in the list of entities.

I use a native query with GROUP BY:

Duplicated rows:

Hibernate returns duplicated rows in the list of entities.
Hibernate returns duplicated rows in the list of entities.
1 answer
2 points
Answered by:
Root-ssh
178180

Probably you have defined @Id in the wrong way in your entity.

You need to set @Id for name an type.

Try:

DocumentEntity.java file:

DocumentKey.java file:

 

0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join