org.hibernate.QueryException: Unable to resolve path [SecWilldosetdate.name],xxxxxxxx...異常處理


今天在寫hql語句的時候出現了這個錯誤,然后一直運行到執行hql這兒就出錯了。頁面報500.

原hql如下:

String hql = "from SecWilldosetdate  where name = 'secEduplan'";

問題如下:

org.hibernate.QueryException: Unable to resolve path [SecWilldosetdate.name], unexpected token [SecWilldosetdate] [from com.sms.security.supervisionAssess.bean.SecWilldosetdate where SecWilldosetdate.name = 'secEduplan']
    org.hibernate.hql.ast.tree.IdentNode.resolveAsNakedComponentPropertyRefLHS(IdentNode.java:219)

折騰了好一會,最后加了個別名好了,不知道是什么原因。還是對hql不熟悉啊。

String hql = "from SecWilldosetdate s where s.name = 'secEduplan'";

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM