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