Hi,
I have a finder which looks like:
I use it as:
But the collection is not ordered as specified in the finder, and is returned in the order it was persisted.
Here is what the console log shows:
select admin0_.id as id14_, admin0_.version as version14_, admin0_.address as address14_, admin0_.city
as city14_, admin0_.country as country14_, admin0_.email as email14_, admin0_.firstname as
firstname14_, admin0_.lastname as lastname14_, admin0_.login as login14_, admin0_.password
as password14_, admin0_.password_salt as password11_14_, admin0_.post_login_url as post12_14_,
admin0_.preference_admin as preference13_14_, admin0_.profile as profile14_, admin0_.super_admin
as super15_14_, admin0_.zip_code as zip16_14_ from admin admin0_ limit 10
Any clue ?
Kind Regards,
Stephane
I have a finder which looks like:
Code:
@Query("SELECT a FROM Admin a ORDER BY a.lastname, a.firstname")
public Page<Admin> findAll(Pageable page);
Code:
Pageable pageRequest = new PageRequest(0, 10);
Page<Admin> admins = adminRepository.findAll(pageRequest);
Here is what the console log shows:
Quote:
select admin0_.id as id14_, admin0_.version as version14_, admin0_.address as address14_, admin0_.city
as city14_, admin0_.country as country14_, admin0_.email as email14_, admin0_.firstname as
firstname14_, admin0_.lastname as lastname14_, admin0_.login as login14_, admin0_.password
as password14_, admin0_.password_salt as password11_14_, admin0_.post_login_url as post12_14_,
admin0_.preference_admin as preference13_14_, admin0_.profile as profile14_, admin0_.super_admin
as super15_14_, admin0_.zip_code as zip16_14_ from admin admin0_ limit 10
Kind Regards,
Stephane