Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java HQL查询中的语法错误_Java_Hibernate_Hql - Fatal编程技术网

Java HQL查询中的语法错误

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

我的dao方法中有以下代码:

        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分钟,我才能接受你的回答:)