[jira] [Commented] (JDO-652) Provision of a typesafe refactor-friendly query capability for JDOQL

2018-11-05 Thread Michael Bouschen (JIRA)


[ 
https://issues.apache.org/jira/browse/JDO-652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16675755#comment-16675755
 ] 

Michael Bouschen commented on JDO-652:
--

Thanks for the feedback, I did not know that I have to use DataNucleus 5.2.

The test case issues are fixed.

I changed QueryTest.executeJDOQLTypedQuery to check both whether there is a 
resultClass and/or a result clause specified in order to decide which 
executeResultXXX method is called. 

I also added a new method to Expression to define an alias for an expression:
{noformat}
/**
 * Method to return an expression with the specified alias assigned to this 
expression.
 * @param alias the alias for this expression
 * @return the expression with an alias
 */
Expression as(String alias);{noformat}
 

With the above changes there is only one error in query.conf, method 
IfElseResult.testPositive1. Exceuting the query results in
{noformat}
ERROR 22003: The resulting value is outside the range for the data type 
DECIMAL/NUMERIC(31,31){noformat}
This is the generated SQL query:
{noformat}
SELECT (CASE WHEN ((SELECT COUNT(*) FROM DATASTOREIDENTITY0.PROJECT_MEMBER 
A0_SUB WHERE A0_SUB.PROJID = A0.DATASTORE_IDENTITY) > 2) THEN (A0.BUDGET * 
1.1999555910790149937383830547332763671875) ELSE (A0.BUDGET * 
1.100088817841970012523233890533447265625) END), A0.PROJID AS 
NUCORDER0 FROM DATASTOREIDENTITY0.PROJECTS A0 WHERE A0.DISCRIMINATOR = 
'org.apache.jdo.tck.pc.company.Project' ORDER BY NUCORDER0{noformat}

> Provision of a typesafe refactor-friendly query capability for JDOQL
> 
>
> Key: JDO-652
> URL: https://issues.apache.org/jira/browse/JDO-652
> Project: JDO
>  Issue Type: New Feature
>  Components: api, specification, tck
>Reporter: Andy Jefferson
>Assignee: Michael Bouschen
>Priority: Major
> Fix For: JDO 3.2
>
> Attachments: JDO-652-api-ifTheElse.txt, JDO-652-api-patch-Andy.txt, 
> JDO-652-patch4.txt, typesafe.patch, typesafe_manifest.patch
>
>
> There are various querying capabilities of this type around. JPA2 has its 
> Criteria query API. Third party solutions like QueryDSL also exist, in its 
> case providing a JDOQL implementation (as well as JPQL, and HQL). We should 
> seriously consider introducing something along these lines in the JDO2.4 
> timeframe. 
> There is a comparison of JPA Criteria with QueryDSL over at 
> http://source.mysema.com/forum/mvnforum/viewthread_thread,49



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (JDO-652) Provision of a typesafe refactor-friendly query capability for JDOQL

2018-11-05 Thread Andy Jefferson (JIRA)


[ 
https://issues.apache.org/jira/browse/JDO-652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16675280#comment-16675280
 ] 

Andy Jefferson edited comment on JDO-652 at 11/5/18 6:32 PM:
-

DataNucleus has supported latest API changes for some time, you're just using 
the wrong version ... 5.1 is frozen (unless people provide backports), 5.2 is 
current.

 

Issues with the tests from a cursory scan:-

IfElseResult.testPositive2 uses "No Reviewer" instead of "No reviewer".

NullResults.testDistinctNavigation is not applying a result class to JDOQL 
single-string, but is to JDOQLTypedQuery.

NullResults.testNavigation is not applying a result class to JDOQL 
single-string, but is to JDOQLTypedQuery.

NullResults.testUnique is not applying a result class to JDOQL single-string, 
but is to JDOQLTypedQuery.

IfElseInFilter.testPositive0 applies an orderBy to JDOQL single-string but not 
to JDOQLTypedQuery.

IfElseInFilter.testPositive1 doesnt set the JDOQLTyped argument (hence the 
error), and also omits to apply ordering to JDOQLTypedQuery.

 

QueryTest.executeJDOQLTypedQuery incorrectly only makes use of resultClass when 
deciding to call 'executeResultXXX'. It should also be looking at whether there 
is a result clause. There are also executeResultXXX methods that don't take in 
the result class (when that is not specified).

 

No idea what you mean by not being able to use a Map with JDOQLTyped ... you 
just specify the result class as a Map, like you'd do it as any other result 
class. Unless you mean just an alias for any result expression? in which case 
no objection to that, the DN internal code already has that, just not the 
public api


was (Author: andy):
DataNucleus has supported latest API changes for some time, you're just using 
the wrong version ... 5.1 is frozen (unless people provide backports), 5.2 is 
current.

 

Issues with the tests from a cursory scan:-

IfElseResult.testPositive2 uses "No Reviewer" instead of "No reviewer".

NullResults.testDistinctNavigation is not applying a result class to JDOQL 
single-string, but is to JDOQLTypedQuery.

NullResults.testNavigation is not applying a result class to JDOQL 
single-string, but is to JDOQLTypedQuery.

NullResults.testUnique is not applying a result class to JDOQL single-string, 
but is to JDOQLTypedQuery.

IfElseInFilter.testPositive0 applies an orderBy to JDOQL single-string but not 
to JDOQLTypedQuery.

IfElseInFilter.testPositive1 doesnt set the JDOQLTyped argument (hence the 
error), and also omits to apply ordering to JDOQLTypedQuery.

 

No idea what you mean by not being able to use a Map with JDOQLTyped ... you 
just specify the result class as a Map, like you'd do it as any other result 
class. Unless you mean just an alias for any result expression? in which case 
no objection to that, the DN internal code already has that, just not the 
public api

> Provision of a typesafe refactor-friendly query capability for JDOQL
> 
>
> Key: JDO-652
> URL: https://issues.apache.org/jira/browse/JDO-652
> Project: JDO
>  Issue Type: New Feature
>  Components: api, specification, tck
>Reporter: Andy Jefferson
>Assignee: Michael Bouschen
>Priority: Major
> Fix For: JDO 3.2
>
> Attachments: JDO-652-api-ifTheElse.txt, JDO-652-api-patch-Andy.txt, 
> JDO-652-patch4.txt, typesafe.patch, typesafe_manifest.patch
>
>
> There are various querying capabilities of this type around. JPA2 has its 
> Criteria query API. Third party solutions like QueryDSL also exist, in its 
> case providing a JDOQL implementation (as well as JPQL, and HQL). We should 
> seriously consider introducing something along these lines in the JDO2.4 
> timeframe. 
> There is a comparison of JPA Criteria with QueryDSL over at 
> http://source.mysema.com/forum/mvnforum/viewthread_thread,49



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (JDO-652) Provision of a typesafe refactor-friendly query capability for JDOQL

2018-11-05 Thread Michael Bouschen (JIRA)


[ 
https://issues.apache.org/jira/browse/JDO-652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16674473#comment-16674473
 ] 

Michael Bouschen edited comment on JDO-652 at 11/5/18 4:11 PM:
---

I checked in patch  JDO-652-patch4.txt (see revision 1845744).

With this checkin I see the following errors and failures:
 * query.conf: Failures: 5, Errors: 19
 * jdoql.conf: Failures: 0, Errors: 10

The errors are because datanucleus does not implement the latest API changes 
(IfThenElseExperssion, min and max expressions, Map.get, String.startsWith). 
The failures are due to unexpected results of the test queries:
 * It looks like distinct is not working (see test class DistinctQuery).
 * The JDOQLTypedQuery API misses a way to specify the keys when the query is 
returing a map similar to the as clause in the single string version (see class 
ResultClassRequirements method testMap). Maybe we can add a method as(String 
name) to Expression.


was (Author: mbo):
I checked in patch  JDO-652-patch4.txt (see revision 1845744).

With this checkin I see the following errors and failures:
 * query.conf: Failures: 5, Errors: 19
 * jdoql.conf: Failures: 0, Errors: 10

The errors are because datanucleus does not implement the latest API changes 
(IfThenElseExperssion, min and max expressions, Map.get, String.startsWith). 
The failures are due to unexpected results of the test queries:
 * It looks like distinct is not working (see test class DistinctQuery).
 * The JDOQLTypedQuery API misses a way to specify the kexs when the query is 
returing a map similar to the as clause in the single string version (see class 
ResultClassRequirements method testMap). Maybe we can add a method as(String 
name) to Expression.

> Provision of a typesafe refactor-friendly query capability for JDOQL
> 
>
> Key: JDO-652
> URL: https://issues.apache.org/jira/browse/JDO-652
> Project: JDO
>  Issue Type: New Feature
>  Components: api, specification, tck
>Reporter: Andy Jefferson
>Assignee: Michael Bouschen
>Priority: Major
> Fix For: JDO 3.2
>
> Attachments: JDO-652-api-ifTheElse.txt, JDO-652-api-patch-Andy.txt, 
> JDO-652-patch4.txt, typesafe.patch, typesafe_manifest.patch
>
>
> There are various querying capabilities of this type around. JPA2 has its 
> Criteria query API. Third party solutions like QueryDSL also exist, in its 
> case providing a JDOQL implementation (as well as JPQL, and HQL). We should 
> seriously consider introducing something along these lines in the JDO2.4 
> timeframe. 
> There is a comparison of JPA Criteria with QueryDSL over at 
> http://source.mysema.com/forum/mvnforum/viewthread_thread,49



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (JDO-652) Provision of a typesafe refactor-friendly query capability for JDOQL

2018-11-05 Thread Andy Jefferson (JIRA)


[ 
https://issues.apache.org/jira/browse/JDO-652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16675280#comment-16675280
 ] 

Andy Jefferson edited comment on JDO-652 at 11/5/18 4:07 PM:
-

DataNucleus has supported latest API changes for some time, you're just using 
the wrong version ... 5.1 is frozen (unless people provide backports), 5.2 is 
current.

 

Issues with the tests from a cursory scan:-

IfElseResult.testPositive2 uses "No Reviewer" instead of "No reviewer".

NullResults.testDistinctNavigation is not applying a result class to JDOQL 
single-string, but is to JDOQLTypedQuery.

NullResults.testNavigation is not applying a result class to JDOQL 
single-string, but is to JDOQLTypedQuery.

NullResults.testUnique is not applying a result class to JDOQL single-string, 
but is to JDOQLTypedQuery.

IfElseInFilter.testPositive0 applies an orderBy to JDOQL single-string but not 
to JDOQLTypedQuery.

IfElseInFilter.testPositive1 doesnt set the JDOQLTyped argument (hence the 
error), and also omits to apply ordering to JDOQLTypedQuery.

 

No idea what you mean by not being able to use a Map with JDOQLTyped ... you 
just specify the result class as a Map, like you'd do it as any other result 
class. Unless you mean just an alias for any result expression? in which case 
no objection to that, the DN internal code already has that, just not the 
public api


was (Author: andy):
DataNucleus has supported latest API changes for some time, you're just using 
the wrong version ... 5.1 is frozen (unless people provide backports), 5.2 is 
current.

 

Issues with the tests from a cursory scan:-

IfElseResult.testPositive2 uses "No Reviewer" instead of "No reviewer".

NullResults.testDistinctNavigation is not applying a result class to JDOQL 
single-string, but is to JDOQLTypedQuery.

NullResults.testNavigation is not applying a result class to JDOQL 
single-string, but is to JDOQLTypedQuery.

NullResults.testUnique is not applying a result class to JDOQL single-string, 
but is to JDOQLTypedQuery.

IfElseInFilter.testPositive0 applies an orderBy to JDOQL single-string but not 
to JDOQLTypedQuery.

IfElseInFilter.testPositive1 doesnt set the JDOQLTyped argument (hence the 
error), and also omits to apply ordering to JDOQLTypedQuery.

 

No idea what you mean by not being able to use a Map with JDOQLTyped ... you 
just specify the result class as a Map, like you'd do it as any other result 
class.

> Provision of a typesafe refactor-friendly query capability for JDOQL
> 
>
> Key: JDO-652
> URL: https://issues.apache.org/jira/browse/JDO-652
> Project: JDO
>  Issue Type: New Feature
>  Components: api, specification, tck
>Reporter: Andy Jefferson
>Assignee: Michael Bouschen
>Priority: Major
> Fix For: JDO 3.2
>
> Attachments: JDO-652-api-ifTheElse.txt, JDO-652-api-patch-Andy.txt, 
> JDO-652-patch4.txt, typesafe.patch, typesafe_manifest.patch
>
>
> There are various querying capabilities of this type around. JPA2 has its 
> Criteria query API. Third party solutions like QueryDSL also exist, in its 
> case providing a JDOQL implementation (as well as JPQL, and HQL). We should 
> seriously consider introducing something along these lines in the JDO2.4 
> timeframe. 
> There is a comparison of JPA Criteria with QueryDSL over at 
> http://source.mysema.com/forum/mvnforum/viewthread_thread,49



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JDO-652) Provision of a typesafe refactor-friendly query capability for JDOQL

2018-11-05 Thread Andy Jefferson (JIRA)


[ 
https://issues.apache.org/jira/browse/JDO-652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16675280#comment-16675280
 ] 

Andy Jefferson commented on JDO-652:


DataNucleus has supported latest API changes for some time, you're just using 
the wrong version ... 5.1 is frozen (unless people provide backports), 5.2 is 
current.

 

Issues with the tests from a cursory scan:-

IfElseResult.testPositive2 uses "No Reviewer" instead of "No reviewer".

NullResults.testDistinctNavigation is not applying a result class to JDOQL 
single-string, but is to JDOQLTypedQuery.

NullResults.testNavigation is not applying a result class to JDOQL 
single-string, but is to JDOQLTypedQuery.

NullResults.testUnique is not applying a result class to JDOQL single-string, 
but is to JDOQLTypedQuery.

IfElseInFilter.testPositive0 applies an orderBy to JDOQL single-string but not 
to JDOQLTypedQuery.

IfElseInFilter.testPositive1 doesnt set the JDOQLTyped argument (hence the 
error), and also omits to apply ordering to JDOQLTypedQuery.

 

No idea what you mean by not being able to use a Map with JDOQLTyped ... you 
just specify the result class as a Map, like you'd do it as any other result 
class.

> Provision of a typesafe refactor-friendly query capability for JDOQL
> 
>
> Key: JDO-652
> URL: https://issues.apache.org/jira/browse/JDO-652
> Project: JDO
>  Issue Type: New Feature
>  Components: api, specification, tck
>Reporter: Andy Jefferson
>Assignee: Michael Bouschen
>Priority: Major
> Fix For: JDO 3.2
>
> Attachments: JDO-652-api-ifTheElse.txt, JDO-652-api-patch-Andy.txt, 
> JDO-652-patch4.txt, typesafe.patch, typesafe_manifest.patch
>
>
> There are various querying capabilities of this type around. JPA2 has its 
> Criteria query API. Third party solutions like QueryDSL also exist, in its 
> case providing a JDOQL implementation (as well as JPQL, and HQL). We should 
> seriously consider introducing something along these lines in the JDO2.4 
> timeframe. 
> There is a comparison of JPA Criteria with QueryDSL over at 
> http://source.mysema.com/forum/mvnforum/viewthread_thread,49



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)