Unfortunately, i cannot find answer on my question. This question appears when i get incorrect data using method findOne(ID id)
.
My project contains three entities each of them contains JPA unidirectional association @OneToMany
.
Example: Class A (contains List of Class B) -> Class B (contains List of Class C) -> Class C
Method findOne(ID id)
return duplicates of Class B in List which relate to Class A. Unlike in the previous method, findById(long id)
return correct number of related entities.
After some research I found out that findOne(ID id)
use Left Outer Join
in sql query.
I want to understand, there is the issue in findOne(ID id)
method or it works properly.
Environment: Spring Data JPA 1.8.0.RELEASE, Hibernate 4.3.8.Final, MySQL