【发布时间】:2009-02-10 16:00:47
【问题描述】:
请求.hbm.xml:
<id name="reqId" type="long" column="REQ_ID">
<generator class="sequence">
<param name="sequence">SEQUENCE</param>
</generator>
</id>
<bag name="lines" lazy="false" >
<key column="REQ_ID" not-null="true" />
<one-to-many class="com.Lines" />
</bag>
Lines.hbm.xml
<id name="lineId" type="string" column="LINE">
<generator class="assigned" />
</id>
<property name="reqId" type="long" column="REQ_ID" />
<bag name="comments">
<key column="LINE" />
<one-to-many class="com.Comments"/>
</bag>
评论.hbm.xml:
Req.java 将包含行列表。和 Line.java 有 cmets 列表。
在使用投影检索列时...如何从 CMNTS 表中检索列。
lines.cmets.commentId 可以在 Projection 中使用,我可以检索列吗?
如何在 CMNTS 表的条件类中定义连接?
【问题讨论】:
标签: hibernate collections