title: Spring data JPA avoid multiple select in many to one relationship
body: <p>I'm using Spring Data JPA and have a many to one relationship from Child to Parent Class using hibernate. I'm writing a search API which would search on child table using some child table columns and return list of child objects along with some data from Parent class for each child object. I'm doing by default eager fetch for many to one relationship. The problem i'm facing is lets say after searching child table 10 entries are returned then hibernate is doing 10 different select queries on parent class to get Parent object for each child object. Is there a way to optimize this ? There is a solution given to similar problem <a href="http://jdpgrailsdev.github.io/blog/2014/09/09/spring_data_hibernate_join.html" rel="nofollow">here</a>  but it is for one to many case. I could not find anything helpful regarding this on web also. Any ideas ?</p>