0
我有一個表自引用領域:Grails的,查詢自引用表
Class Book{
Integer id
String name
Book version
}
當我添加的書沒有「版本」,版本字段爲空 現在我要查詢對於沒有版本記錄書籍表(其版本字段爲空),下面的代碼將無法正常工作:
def results = Book.withCriteria{
eq("version", "null")
}
但我發現了此異常:
org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of Book.id
我應該使用什麼查詢?
順便說一句,這是我得到的錯誤: org.hibernate.PropertyAccessException:發生IllegalArgumentException發生調用get.get – iMiX