2016-05-23 106 views
0

此NamedQuery有什麼問題?沒有對Hibernate的5工作,但在工作的OpenJPA 1.2.2JPA Hibernate命名查詢中的錯誤

@NamedQuery(name = "Dic_listDByVal", query = "SELECT d FROM Dict d " 
       + " WHERE d.memory = m.memory and d.dic = :dic and (m.value LIKE :value)" 
       + " ORDER BY d.sortOrder") 
+0

什麼是'這裏M''m.memory '? –

回答

0

我想你還沒有定義m(in m.memory)這裏,這意味着你必須已經錯過了JOIN條款

+0

是的,缺少m,應該看起來像: @NamedQuery(name =「Dic_listDByVal」,query =「SELECT d FROM Dict d,Mem m」 +「WHERE d.memory = m.memory and d.dic =:dic和(m.value LIKE:value)「 +」ORDER BY d.sortOrder「) – Wait