I created this two entites to demonstrate my problem:
OwnerEntity.java:
@Entity
public class OwnerEntity {
@Id
@GeneratedValue(strategy = Ge
String orderSort=page.getSort().toString();
Pageable page1 =
PageRequest.of(page.getPageNumber(),page.getPageSize(),
JpaSort.unsafe(Sort.Direction.valueOf
(orderSort.substring(page.getSort().toString().indexOf(':')+2,
orderSort.length())),
orderSort.substring(0,page.getSort().toString().indexOf(')')+1)));