2010-05-20 79 views
2

我有以下HQL查詢:問題上HQL查詢

from Admin a where a.genericTable is null or (a.genericTable.allowInsertion = true or a.genericTable.allowInsertion is null) 

的問題是,該結果集,這還不包括由在過濾器上的所有條目:a.genericTable is null

有誰知道這是爲什麼?

謝謝!

+0

你有,你認爲應該返回一些示例行? – 2010-05-20 16:13:06

回答

1

嘗試左連接:

from Admin as a left join a.genericTable as g 
where (g is null or (g.allowInsertion = true or g.allowInsertion is null))