1
我使用以下HQL查询尝试加载一组对象,并根据在以下链接中找到的建议选择一个Student对象。 http://www.javalobby.org/articles/hibernate-query-101/在HQL查询中预加载对象
from gradebook.model.Student student where student.studentId=1 left join fetch student.scores
我碰到下面的错误。 意外令牌:左边第1行,第64列 我粘贴了下面我的映射文件的相关部分。
<set name="scores" inverse="true" lazy="true" table="score" fetch="select">
<key>
<column name="student_id" not-null="true" />
</key>
<one-to-many class="gradebook.model.Score" />
</set>
谢谢,移动连接解决了问题。另外,我所引用的链接中的语法是错误的,我的SQL有点生疏,所以我将查看您发布的教程链接。 – Jared 2009-11-02 15:31:31