2
Iam嘗試使用where子句從兩個不同表中獲取數據。我將能夠寫一個where子句的屬性映射的類。集合映射的where子句
例如:I有兩個類
Class box{
private int id;
private String name;
private int colorId;
private int size;
//getter
//setter
}
class color{
private int colorId;
private String colourName;
Private set<box> boxes;
}
映射:
<class name="box" table="box">
<id name="id" column="id">
<generator class="native"/>
</id>
<propert name="name" column="name"/>
<property name="size" column="size"/>
</class>
<class name="color" table="color">
<id name="id" column="id">
<generator class="native"/>
</id>
<propert name="name" column="name"/>
<set name="boxes" table="box" lazy="false" fetch="join">
<key><column name="colorId" /></key>
<one-to-many class="box" not-found="ignore"/>
</set>
</class>
我可以寫一個HQL像從彩色其中boxes.size> 10
如何能我實現這個使用HQL或任何其他方法。請建議。