我需要使用HQL,兩者都具有共同的列來組合2個表,但table1
公共列是integer
和table2
公共列是String
如何用cast來編寫hql查詢?
例如,
select a.id as id,a.name as name,b.address as address
from Personal as a,Home as b
where a.id=b.studid
這裏a.id
被一個integer
而b.stduid
是string
,但兩列的數據是相同的。
如何使用hql查詢得到查詢結果?
是的我的查詢是錯誤的,但我需要使用hql cast這個查詢的結果...是否有可能? – ver 2011-01-25 08:52:58
我認爲它只能在休眠狀態下使用,但是您使用的是JPA? @axtavt給你的鏈接到休眠文檔錯誤,我是嗎? – Eduard 2011-01-26 12:50:53