Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2770

false boolean literal doesn't work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.4.2, 2.4.3, 3.0.0
    • 3.1.0
    • kernel
    • None

    Description

      Using CriteriaBuilder.literal(Boolean.FALSE) in expressions leads to literal value being treated as TRUE instead.

      See https://github.com/veselov/Standalone-JPA-Test-Demo/tree/OPENJPA-2770 for test case.
      I've also attached the extracted branch here.
      Running

      $ mvn -Dderby.language.logStatementText=true test
      

      shows the problem. Though the cb.literal(Boolean.FALSE) is use in cb.equal(), the query is:

      Wed Jan 23 00:24:51 CET 2019 Thread[main,5,main] (XID = 283), (SESSIONID = 11), (DATABASE = memory:jpaDemoDB), (DRDAID = null), Executing prepared statement: SELECT t0.user_id, t0.about, t0.firstName, t0.homePage, t0.lastName, t0.userName, t0.woo FROM Person t0 WHERE (t0.woo = ?) :End prepared statement with 1 parameters begin parameter #1: true :end parameter
      

      I changed versions to 2.4.3 and 3.0.0, the problem is still there.

      Attachments

        Activity

          People

            romain.manni-bucau Romain Manni-Bucau
            pveselov Pawel Veselov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: