Hibernate + Derby: Comparisons between 'BOOLEAN' and 'INTEGER' are not supported

前端 未结 4 1784
执笔经年
执笔经年 2021-01-13 16:32

I have a problem with querying Derby database. I am using Hibernate with JPA. Problem is related (probably) to boolean columns. Each query ends with error:

org.h

4条回答
  •  天涯浪人
    2021-01-13 17:11

    You have to set your boolean as a parameter:

    String queryString = "SELECT t FROM Task t WHERE t.deleted = :trueValue";
    Query query = entityManager.createQuery(queryString);
    query.setParameter("trueValue", true);
    query.getResultList();
    

    Hope it will work for you ;)

提交回复
热议问题