0
我總是得到錯誤列太多當我執行此查詢。HQL子查詢的查詢選擇
SELECT o FROM Overlay o WHERE (:coordinate) IN ELEMENTS(o.blocksCoordinates)
如果我在SQL做它的工作原理:
Select * from Overlay overlay0_ where (0,0) in (select x, y from ...
座標是用x和y的值一個簡單的嵌入式實體。
@ElementCollection
private Set<Coordinate> blocksCoordinates = new HashSet<Coordinate>();
我的座標實體:
@Embeddable
public class Coordinate implements Serializable {
private static final long serialVersionUID = -5866341829302555966L;
protected int x;
protected int y;
我在做什麼錯?
沒有工作。 :-(同樣的錯誤:org.hibernate.HibernateException:所致。SqlNode的文字並沒有提及列 – mkuff
的預期數量也許Embedded不適合此查詢 – mkuff
x和y的最後解決辦法工作得很好非常感謝! ;-) – mkuff