[jira] [Commented] (TORQUE-363) Criterion handles "IS NULL" incorrectly

2023-04-18 Thread Georg Kallidis (Jira)


[ 
https://issues.apache.org/jira/browse/TORQUE-363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17713596#comment-17713596
 ] 

Georg Kallidis commented on TORQUE-363:
---

yes, that's it IMO! I encourage you to add this new constructor and may be a 
check in CriterionTest#testIsNullInCriterion or another test. 

> Criterion handles "IS NULL" incorrectly
> ---
>
> Key: TORQUE-363
> URL: https://issues.apache.org/jira/browse/TORQUE-363
> Project: Torque
>  Issue Type: Bug
>  Components: Runtime
>Affects Versions: 5.0, 5.1
>Reporter: Max Philipp Wriedt
>Assignee: Max Philipp Wriedt
>Priority: Major
>  Labels: criteria_api, criterion
>
> When using Criterion and want to use ISNULL (and maybe also applicable to 
> ISNOTNULL)
> {code:java}
> Criterion criterion1 = new Criterion(ID, Criteria.ISNULL); {code}
> The generated Code adds an equal-sign (=). In a Criteria this is not the case.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org



[jira] [Commented] (TORQUE-363) Criterion handles "IS NULL" incorrectly

2023-04-15 Thread Max Philipp Wriedt (Jira)


[ 
https://issues.apache.org/jira/browse/TORQUE-363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17712644#comment-17712644
 ] 

Max Philipp Wriedt commented on TORQUE-363:
---

We could handle a Criterion constructed with SqlEnum as second value:

 
{code:java}
public Criterion(final Object lValue, final SqlEnum sqlEnum)
{
this(lValue, null, sqlEnum, null, null);
} {code}
or do I overlook something?

 

> Criterion handles "IS NULL" incorrectly
> ---
>
> Key: TORQUE-363
> URL: https://issues.apache.org/jira/browse/TORQUE-363
> Project: Torque
>  Issue Type: Bug
>  Components: Runtime
>Affects Versions: 5.0, 5.1
>Reporter: Max Philipp Wriedt
>Priority: Critical
>  Labels: criteria_api, criterion
>
> When using Criterion and want to use ISNULL (and maybe also applicable to 
> ISNOTNULL)
> {code:java}
> Criterion criterion1 = new Criterion(ID, Criteria.ISNULL); {code}
> The generated Code adds an equal-sign (=). In a Criteria this is not the case.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org



[jira] [Commented] (TORQUE-363) Criterion handles "IS NULL" incorrectly

2023-03-31 Thread Georg Kallidis (Jira)


[ 
https://issues.apache.org/jira/browse/TORQUE-363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17707186#comment-17707186
 ] 

Georg Kallidis commented on TORQUE-363:
---

You're right - it should be possible using this simple constructor for an "is 
null" check, as this is just an SqlEnum. Internally though an comparison object 
is used, which as the javadoc comment for this constructor says is set to 
SqlEnum.EQUALS. That is, if using _another_ constructor this succeeds:
{code:java}
Criterion criterion1 = new Criterion(
 new ColumnImpl("myTable", "myColumn"), null, Criteria.ISNULL);
assertEquals("myTable.myColumn IS NULL",
criterion1.toString());
{code}
This is of course not as intuitive as it should be - a user expects to use 
SQLEnum.ISNULL like any other SQLEnum as a right value. 
Unfortunately the code in org.apache.torque.criteria.Criterion is not very 
easily changed without becoming quite unreadable.

We try to find a (simple) solution .. any ideas if course always appreciated! 
I'll add a test in
CriterionTest at least soon.{color}

> Criterion handles "IS NULL" incorrectly
> ---
>
> Key: TORQUE-363
> URL: https://issues.apache.org/jira/browse/TORQUE-363
> Project: Torque
>  Issue Type: Bug
>  Components: Runtime
>Affects Versions: 5.0, 5.1
>Reporter: Max Philipp Wriedt
>Priority: Critical
>  Labels: criteria_api, criterion
>
> When using Criterion and want to use ISNULL (and maybe also applicable to 
> ISNOTNULL)
> {code:java}
> Criterion criterion1 = new Criterion(ID, Criteria.ISNULL); {code}
> The generated Code adds an equal-sign (=). In a Criteria this is not the case.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org