I have this request working good with queryDSL
:
Iterable<AO> query_result = new JPAQuery(entityManager).from(ao)
.leftJoin( ao.lots , lot )
.leftJoin( ao.acs , ac )
.where(where).distinct()
.list(ao);
But what is its equivalent if we use it with spring data jpa
ao_respository.findAll(Predicate arg0, Pageable arg1);
Because i want to return a Page
and just with querydsl
it doesn't implement Page
without spring data jpa
.
I try to put my where
in Predicate arg0
but i got this exception
Undeclared path 'lot '. Add this path as a source to the query to be able to reference it
where lot
is declared as QLot lot = QLot.lot;
I created my own Page class and executed the query like this:
My Page class:
It works but I got this warning
Returning a
Page
:And I created this function to get
OrderSpecifier
: