Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为了使用hibernate从db中获取排序值,我使用这个NamedQuery:
@NamedQuery( name = "searchnearestdesc", query = "select t FROM Result t WHERE t.indec=:e" + "t.var<=:f ORDER BY var DESC" )
但是,我得到了异常,我的错误是什么?
您的子句之间需要一个 AND,连接字符串时也不要忘记尾随空格;)
@NamedQuery( name = "searchnearestdesc", query = "select t FROM Result t WHERE t.indec=:e AND " + "t.var<=:f ORDER BY var DESC" )