2
我的实体的定义如下:如何在HQL中按列表大小选择对象?
public class Entity implements Serializeable {
@ManyToMany(mappedBy="entities")
private List<OtherEntity> otherEntities;
}
我如何在HQL选择所有实体具有比一个更OtherEntity?
我的实体的定义如下:如何在HQL中按列表大小选择对象?
public class Entity implements Serializeable {
@ManyToMany(mappedBy="entities")
private List<OtherEntity> otherEntities;
}
我如何在HQL选择所有实体具有比一个更OtherEntity?
我认为这应该工作。这将生成一个带有子查询的SQL - 不会获取它并在内存中对其进行过滤。
from Entity e where e.otherEntities.size > 1
非常感谢! :) – mkuff