You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Pawel Veselov (JIRA)" <ji...@apache.org> on 2019/01/22 23:36:00 UTC
[jira] [Updated] (OPENJPA-2770) false boolean literal doesn't work
[ https://issues.apache.org/jira/browse/OPENJPA-2770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pawel Veselov updated OPENJPA-2770:
-----------------------------------
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
{noformat}
$ mvn -Dderby.language.logStatementText=true test
{noformat}
shows the problem. Though the cb.literal(Boolean.FALSE) is use in cb.equal(), the query is:
{noformat}
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
{noformat}
was:
Using CriteriaBuilder.literal(Boolean.FALSE) in expressions leads to literal value being treated as TRUE instead.
> false boolean literal doesn't work
> ----------------------------------
>
> Key: OPENJPA-2770
> URL: https://issues.apache.org/jira/browse/OPENJPA-2770
> Project: OpenJPA
> Issue Type: Bug
> Components: kernel
> Affects Versions: 2.4.2
> Reporter: Pawel Veselov
> Priority: Major
>
> 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
> {noformat}
> $ mvn -Dderby.language.logStatementText=true test
> {noformat}
> shows the problem. Though the cb.literal(Boolean.FALSE) is use in cb.equal(), the query is:
> {noformat}
> 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
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)