2014-12-05 83 views
0

在我的項目的一些,我發現下面的語法什麼是where子句

createQuery("select stuInfo from StudentInfo stuInfo, IN(stuInfo.studentList) studentList " 
    + "where stuInfo.completed =:completed and studentList.Date is null"); 

我試圖谷歌之前的關鍵字使用Hbernate它有什麼用的IN關鍵字where子句前,但我沒有找到關於這個概念的任何解釋。

+1

你有任何證據證明它是合法的HQL語法嗎? – 2014-12-05 10:44:20

+0

我不能提供任何證據,但我可以說這個查詢正在我的項目從過去2年,在調試過程中,我發現這一點。 – Amit 2014-12-05 10:46:04

+0

「StudentInfo.studentList」的類型是什麼? – 2014-12-05 10:50:25

回答

1

我檢查了它,它只是一個用於內部連接速記,你的情況

select stuInfo from StudentInfo stuInfo inner join stuInfo.studentList studentList ... 

這裏居然是更有意義的使用別名student,不studentList,因爲這是你指的是什麼它。

+0

您有任何鏈接 – Amit 2014-12-05 10:59:04

+0

我在我的機器上試過了。沒有鏈接(還)。 – 2014-12-05 10:59:53

+0

感謝Marko! – Amit 2014-12-05 11:02:00