我正在阅读这个问题How to use OrderBy with findAll in Spring Data
这个问题How to sort by multiple properties in Spring Data (JPA) derived queries?
问题Spring JPA - Find By EmbeddedId partially不能回答我的问题,因为我的问题不是由嵌套的“查找其他订单”询问。
但是我有一个嵌套的ID。
public class OutEntity implements java.io.Serializable {
private OutEntityId id;
private String nameDepartment;
private String nameMunicipality;
...
Id
@Embeddable
public class OutEntityId implements java.io.Serializable {
private Long codeDepartment;
private Long codeMunicipality;
...
我想知道如何获得全部,按codeDepartment
升序和codeMunicipality
升序排序
没有本机查询是否可能?