Search code examples
hibernatejpanamed-query

JPA Hibernate errors in named queries


What is wrong with this NamedQuery? Did not work on Hibernate 5 but worked on Openjpa 1.2.2

 @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")

Solution

  • I guess you have not defined m( in m.memory) here, meaning you must have missed a JOIN clause