Hi,
I have a query in spring-data and I'm using pagination repository.
I'm having issues with sorting (using the Pageable object) when it comes does to sort by aggregated fields...
for example - assuming I have a
my query isCode:public class Job { @OneToMany(fetch = FetchType.LAZY) @JoinColumn(name = "job_id") private Set<SomeObject> someObjects; }
and I'd like to sort based on the count() .Code:select j.id, count(j.someObjects) from Job
I've tried numerous options - none were successful.. (such as providing alias to the field, sort by "count(j....)")
btw - JPA provider is hibernate 4
any help would be greatly appreciated
Yoni



Reply With Quote
