Java HQL查询中的语法错误
我的dao方法中有以下代码:Java HQL查询中的语法错误,java,hibernate,hql,Java,Hibernate,Hql,我的dao方法中有以下代码: TypedQuery<Application> query = em.createQuery( "FROM Application a " + "WHERE LOWER(a.candidate.firstName LIKE :firstName) " + "OR LOWER(a.candidate.lastName LIKE :lastName) "
TypedQuery<Application> query = em.createQuery(
"FROM Application a "
+ "WHERE LOWER(a.candidate.firstName LIKE :firstName) "
+ "OR LOWER(a.candidate.lastName LIKE :lastName) "
+ "OR (a.candidate.phoneNumber LIKE :phoneNumber) "
+ "OR LOWER(a.candidate.email LIKE :email) "
+ "OR LOWER(a.candidate.postcode LIKE :postcode)"
, Application.class);
query = query.setParameter("firstName", candidate.getFirstName());
query = query.setParameter("lastName", candidate.getLastName());
query = query.setParameter("phoneNumber", candidate.getPhoneNumber());
query = query.setParameter("email", candidate.getEmail());
query = query.setParameter("postcode", candidate.getPostcode());
我的查询可能有问题,但我看不出。。。感谢您的帮助。这是您的括号
LOWER(a.candidate.firstName LIKE :firstName)
应该是:
LOWER(a.candidate.firstName) LIKE :firstName
等等。这是你的括号
LOWER(a.candidate.firstName LIKE :firstName)
应该是:
LOWER(a.candidate.firstName) LIKE :firstName
等等。这是你的括号
LOWER(a.candidate.firstName LIKE :firstName)
应该是:
LOWER(a.candidate.firstName) LIKE :firstName
等等。这是你的括号
LOWER(a.candidate.firstName LIKE :firstName)
应该是:
LOWER(a.candidate.firstName) LIKE :firstName
等等。非常感谢!现在给我8分钟,我才能接受你的回答:)非常感谢!现在给我8分钟,我才能接受你的回答:)非常感谢!现在给我8分钟,我才能接受你的回答:)非常感谢!现在给我8分钟,我才能接受你的回答:)