How to keep order provided in “in” clause in Spring Data JPA or Hibernate [duplicate]
问题 This question already has answers here : Spring data repository: findBySomething***In*** and result order (2 answers) Closed 2 years ago . I have a pretty simple query which retrieves values base on "in" clause. List that comes as "in" argument is appropriately sorted. Query : @Query(value = "select i from ItemEntity i where i.secondaryId in :ids") List<ItemEntity> itemsIn(@Param("ids") List<UUID> ids, Pageable pageable); I need results to be ordered the same way as List<UUID> ids , is it