fix sort for JPA entities