db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r1845744 [1/9] - in /db/jdo/trunk: copyjdorijars/ tck/ tck/src/main/java/org/apache/jdo/tck/pc/company/ tck/src/main/java/org/apache/jdo/tck/pc/mylib/ tck/src/main/java/org/apache/jdo/tck/query/ tck/src/main/java/org/apache/jdo/tck/query/de...
Date Sun, 04 Nov 2018 18:37:24 GMT
Author: mbo
Date: Sun Nov  4 18:37:24 2018
New Revision: 1845744

URL: http://svn.apache.org/viewvc?rev=1845744&view=rev
Log:
JDO-652: extending existing query test cases to run the JDOQLTypedQuery version of the test cases

Modified:
    db/jdo/trunk/copyjdorijars/pom.xml
    db/jdo/trunk/tck/pom.xml
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Company.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/DentalInsurance.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Department.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Employee.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/FullTimeEmployee.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Insurance.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/MedicalInsurance.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/MeetingRoom.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Person.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Project.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/mylib/PrimitiveTypes.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/mylib/VersionedPCPoint.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/QueryElementHolder.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/QueryTest.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/delete/DeletePersistentAll.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/delete/DeleteQueryElements.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/Cast.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/CharacterAndStringLiterals.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/ComparingCollectionFieldToNull.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/ComparingPersistentAndNonPersistentInstance.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/DenoteUniquenessInFilter.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/Having.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/IdentifiersEqualFieldNames.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/IfElseInFilter.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/MultipleIdenticalImports.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationComparisonWithNull.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughACollectionField.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughANullValuedField.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughReferencesUsesDotOperator.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NullCollectionsAndContainsMethod.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NullCollectionsAndIsEmpty.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/OrderingSpecification.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/RangeAsString.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/SeparateNamespaceForTypeNames.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/keywords/SingleString.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/methods/StartsWithAndEndsWith.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/methods/SupportedCollectionMethods.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/methods/SupportedDateMethods.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/methods/SupportedJDOHelperMethods.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/methods/SupportedListMethods.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMapMethods.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMathMethods.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/methods/SupportedOptionalMethods.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/methods/SupportedStringMethods.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/operators/EqualityAndComparisonsBetweenDateFieldsAndParameters.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/operators/EqualityAndComparisonsBetweenStringFieldsAndParameters.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/operators/Instanceof.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/operators/Modulo.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/operators/StringConcatenation.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/parameters/ImplicitParameters.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/parameters/OrderOfParameters.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/variables/UnconstrainedVariable.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/variables/VariablesWithoutExtent.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/AggregateResult.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/DefaultResult.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/DistinctCandidateInstances.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/DistinctQuery.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/Grouping.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/IfElseResult.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/MethodsInResult.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/NPEInResultExpr.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/NullResults.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/ResultClassRequirements.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/ResultExpressions.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/ShapeOfResult.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/Unique.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/VariableInResult.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/VariableInResultMultipleNavigation.java
    db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/result/VariableInResultNavigation.java
    db/jdo/trunk/tck/src/main/resources/conf/jdo-signatures.txt

Modified: db/jdo/trunk/copyjdorijars/pom.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/copyjdorijars/pom.xml?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/copyjdorijars/pom.xml (original)
+++ db/jdo/trunk/copyjdorijars/pom.xml Sun Nov  4 18:37:24 2018
@@ -93,22 +93,31 @@
     <dependency>
       <groupId>org.datanucleus</groupId>
       <artifactId>datanucleus-core</artifactId>
-      <version>5.1.9</version>
+      <version>5.1.13-SNAPSHOT</version>
+      <!--<version>5.2.0-m2-SNAPSHOT</version>-->  
     </dependency>
     <dependency>
       <groupId>org.datanucleus</groupId>
       <artifactId>datanucleus-rdbms</artifactId>
-      <version>5.1.9</version>
+      <version>5.1.12-SNAPSHOT</version>
+      <!--<version>5.2.0-m2-SNAPSHOT</version> -->  
     </dependency>
     <dependency>
       <groupId>org.datanucleus</groupId>
       <artifactId>datanucleus-api-jdo</artifactId>
-      <version>5.1.6</version>
+      <version>5.1.10-SNAPSHOT</version>
+      <!--<version>5.2.0-m2-SNAPSHOT</version> -->  
+    </dependency>
+    <dependency>
+      <groupId>org.datanucleus</groupId>
+      <artifactId>datanucleus-jdo-query</artifactId>
+      <version>5.0.8-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.datanucleus</groupId>
       <artifactId>datanucleus-api-jpa</artifactId>
-      <version>5.1.6</version>
+      <version>5.1.10-SNAPSHOT</version>
+      <!--<version>5.2.0-m2-SNAPSHOT</version>-->  
     </dependency>
     <dependency>
       <groupId>log4j</groupId>

Modified: db/jdo/trunk/tck/pom.xml
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/pom.xml?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/pom.xml (original)
+++ db/jdo/trunk/tck/pom.xml Sun Nov  4 18:37:24 2018
@@ -123,10 +123,17 @@
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
         </dependency>
-<!--        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-        </dependency>-->
+        <dependency>
+            <groupId>org.datanucleus</groupId>
+            <artifactId>datanucleus-api-jdo</artifactId>
+	    <version>5.1.10-SNAPSHOT</version>
+            <!--<version>5.2.0-m2-SNAPSHOT</version>-->
+        </dependency>
+        <dependency>
+            <groupId>org.datanucleus</groupId>
+            <artifactId>datanucleus-jdo-query</artifactId>
+            <version>5.0.8-SNAPSHOT</version>
+        </dependency>
         <dependency>
             <groupId>commons-logging</groupId>
             <artifactId>commons-logging</artifactId>

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Company.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Company.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Company.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Company.java Sun Nov  4 18:37:24 2018
@@ -32,10 +32,13 @@ import java.util.Date;
 import org.apache.jdo.tck.util.DeepEquality;
 import org.apache.jdo.tck.util.EqualityHelper;
 
+import javax.jdo.annotations.PersistenceCapable;
+
 /**
  * This class represents information about a company.
  */
-public class Company 
+@PersistenceCapable
+public class Company
     implements ICompany, Serializable, Comparable, Comparator, DeepEquality {
 
     private long        companyid;

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/DentalInsurance.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/DentalInsurance.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/DentalInsurance.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/DentalInsurance.java Sun Nov  4 18:37:24 2018
@@ -22,10 +22,13 @@ import java.math.BigDecimal;
 import org.apache.jdo.tck.util.DeepEquality;
 import org.apache.jdo.tck.util.EqualityHelper;
 
+import javax.jdo.annotations.PersistenceCapable;
+
 /**
  * This class represents a dental insurance carrier selection for a
  * particular <code>Employee</code>.
  */
+@PersistenceCapable
 public class DentalInsurance extends Insurance implements IDentalInsurance {
 
     private BigDecimal lifetimeOrthoBenefit;

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Department.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Department.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Department.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Department.java Sun Nov  4 18:37:24 2018
@@ -31,9 +31,12 @@ import java.util.Set;
 import org.apache.jdo.tck.util.DeepEquality;
 import org.apache.jdo.tck.util.EqualityHelper;
 
+import javax.jdo.annotations.PersistenceCapable;
+
 /**
  * This class represents a department within a company.
  */
+@PersistenceCapable
 public class Department
     implements IDepartment, Serializable, Comparable, Comparator, DeepEquality {
 

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Employee.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Employee.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Employee.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Employee.java Sun Nov  4 18:37:24 2018
@@ -25,12 +25,14 @@ import java.util.Date;
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.jdo.tck.util.DeepEquality;
 import org.apache.jdo.tck.util.EqualityHelper;
 
+import javax.jdo.annotations.PersistenceCapable;
+
 /**
  * This class represents an employee.
  */
+@PersistenceCapable
 public abstract class Employee extends Person implements IEmployee {
 
     private Date             hiredate;

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/FullTimeEmployee.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/FullTimeEmployee.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/FullTimeEmployee.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/FullTimeEmployee.java Sun Nov  4 18:37:24 2018
@@ -19,12 +19,14 @@ package org.apache.jdo.tck.pc.company;
 
 import java.util.Date;
 
-import org.apache.jdo.tck.util.DeepEquality;
 import org.apache.jdo.tck.util.EqualityHelper;
 
+import javax.jdo.annotations.PersistenceCapable;
+
 /**
  * This class represents a full-time employee.
  */
+@PersistenceCapable
 public class FullTimeEmployee extends Employee implements IFullTimeEmployee {
 
     private double  salary;

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Insurance.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Insurance.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Insurance.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Insurance.java Sun Nov  4 18:37:24 2018
@@ -24,11 +24,14 @@ import java.util.Comparator;
 import org.apache.jdo.tck.util.DeepEquality;
 import org.apache.jdo.tck.util.EqualityHelper;
 
+import javax.jdo.annotations.PersistenceCapable;
+
 /**
  * This class represents an insurance carrier selection for a particular
  * <code>Employee</code>.
  */
-public abstract class Insurance 
+@PersistenceCapable
+public abstract class Insurance
     implements IInsurance, Serializable, Comparable, Comparator, DeepEquality  {
 
     private long     insid;

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/MedicalInsurance.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/MedicalInsurance.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/MedicalInsurance.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/MedicalInsurance.java Sun Nov  4 18:37:24 2018
@@ -22,10 +22,13 @@ import java.io.Serializable;
 import org.apache.jdo.tck.util.DeepEquality;
 import org.apache.jdo.tck.util.EqualityHelper;
 
+import javax.jdo.annotations.PersistenceCapable;
+
 /**
  * This class represents a dental insurance carrier selection for a
  * particular <code>Employee</code>.
  */
+@PersistenceCapable
 public class MedicalInsurance extends Insurance implements IMedicalInsurance {
 
     private String planType; // possible values: "PPO", "EPO", "NPO" 

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/MeetingRoom.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/MeetingRoom.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/MeetingRoom.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/MeetingRoom.java Sun Nov  4 18:37:24 2018
@@ -23,10 +23,13 @@ import java.util.Comparator;
 import org.apache.jdo.tck.util.DeepEquality;
 import org.apache.jdo.tck.util.EqualityHelper;
 
+import javax.jdo.annotations.PersistenceCapable;
+
 /**
  * This class represents a meeting room.
  */
-public class MeetingRoom 
+@PersistenceCapable
+public class MeetingRoom
     implements IMeetingRoom, Serializable, Comparable, Comparator, DeepEquality {
 
     private long    roomid;

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Person.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Person.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Person.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Person.java Sun Nov  4 18:37:24 2018
@@ -31,10 +31,13 @@ import java.util.Map;
 import org.apache.jdo.tck.util.DeepEquality;
 import org.apache.jdo.tck.util.EqualityHelper;
 
+import javax.jdo.annotations.PersistenceCapable;
+
 /**
  * This class represents a person.
  */
-public class Person 
+@PersistenceCapable
+public class Person
     implements IPerson, Serializable, Comparable, Comparator, DeepEquality  {
 
     private long    personid;

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Project.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Project.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Project.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/company/Project.java Sun Nov  4 18:37:24 2018
@@ -30,11 +30,14 @@ import java.math.BigDecimal;
 import org.apache.jdo.tck.util.DeepEquality;
 import org.apache.jdo.tck.util.EqualityHelper;
 
+import javax.jdo.annotations.PersistenceCapable;
+
 /**
  * This class represents a project, a budgeted task with one or more
  * employees working on it.
  */
-public class Project 
+@PersistenceCapable
+public class Project
     implements IProject, Serializable, Comparable, Comparator, DeepEquality  {
 
     private long       projid;

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/mylib/PrimitiveTypes.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/mylib/PrimitiveTypes.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/mylib/PrimitiveTypes.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/mylib/PrimitiveTypes.java Sun Nov  4 18:37:24 2018
@@ -17,11 +17,13 @@
  
 package org.apache.jdo.tck.pc.mylib;
 
+import javax.jdo.annotations.PersistenceCapable;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.Date;
 
+@PersistenceCapable
 public class PrimitiveTypes implements Serializable {
 
     private static long counter = new Date().getTime();

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/mylib/VersionedPCPoint.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/mylib/VersionedPCPoint.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/mylib/VersionedPCPoint.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/pc/mylib/VersionedPCPoint.java Sun Nov  4 18:37:24 2018
@@ -17,6 +17,7 @@
  
 package org.apache.jdo.tck.pc.mylib;
 
+import javax.jdo.annotations.PersistenceCapable;
 import java.io.Serializable;
 import java.util.Date;
 
@@ -25,6 +26,7 @@ import java.util.Date;
 *
 * @author Marina Vatkina
 */
+@PersistenceCapable
 public class VersionedPCPoint implements Serializable {
     
     

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/QueryElementHolder.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/QueryElementHolder.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/QueryElementHolder.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/QueryElementHolder.java Sun Nov  4 18:37:24 2018
@@ -18,8 +18,10 @@
 package org.apache.jdo.tck.query;
 
 import javax.jdo.Extent;
+import javax.jdo.JDOQLTypedQuery;
 import javax.jdo.PersistenceManager;
 import javax.jdo.Query;
+import java.util.Map;
 
 /**
  * This class is an abstraction of a JDOQL query,
@@ -56,6 +58,8 @@ public class QueryElementHolder {
     private String toString;
     private Long   fromLong;
     private Long   toLong;
+    private JDOQLTypedQuery<?> jdoqlTypedQuery;
+    private Map<String, ?> paramValues;
     
     /**
      * Returns an instance of this class holding the given arguments
@@ -103,7 +107,58 @@ public class QueryElementHolder {
         this.fromString = from;
         this.toString = to;
     }
-    
+
+    /**
+     * Returns an instance of this class holding the given arguments
+     * such as the candidate class, the filter, etc.
+     * The given arguments represent JDOQL query elements.
+     * It is valid to pass <code>null</code> as a value
+     * for JDOQL querys elements. Such elements are not transfered into a
+     * JDO {@link javax.jdo.Query} instance.
+     * Instead, the default of JDO {@link javax.jdo.Query} instance is taken.
+     * @param unique the JDOQL unique query element
+     * @param result the JDOQL result query element
+     * @param resultClass the JDOQL result class query element
+     * @param candidateClass the JDOQL candidate class query element
+     * @param excludeSubClasses the JDOQL exclude subclasses query element
+     * @param filter the JDOQL filter query element
+     * @param variables the JDOQL variables query element
+     * @param parameters the JDOQL parameters query element
+     * @param imports the JDOQL imports query element
+     * @param grouping the JDOQL grouping query element
+     * @param ordering the JDOQL ordering query element
+     * @param from the JDOQL range from query element
+     * @param to the JDOQL range to query element
+     */
+    public QueryElementHolder(Boolean unique, String result,
+                              Class resultClass, Class candidateClass,
+                              Boolean excludeSubClasses, String filter,
+                              String variables, String parameters, String imports,
+                              String grouping, String ordering, String from, String to,
+                              JDOQLTypedQuery<?> jdoqlTypedQuery,
+                              Map<String, ?> paramValues) {
+        if (from == null ^ to == null) {
+            throw new IllegalArgumentException(
+                    "Arguments from and to must both be null, " +
+                            "or must not be null both.");
+        }
+        this.unique = unique;
+        this.result = result;
+        this.resultClass = resultClass;
+        this.candidateClass = candidateClass;
+        this.excludeSubClasses = excludeSubClasses;
+        this.filter = filter;
+        this.variables = variables;
+        this.parameters = parameters;
+        this.imports = imports;
+        this.grouping = grouping;
+        this.ordering = ordering;
+        this.fromString = from;
+        this.toString = to;
+        this.jdoqlTypedQuery = jdoqlTypedQuery;
+        this.paramValues = paramValues;
+    }
+
     /**
      * Returns an instance of this class holding the given arguments
      * such as the candidate class, the filter, etc. 
@@ -145,6 +200,52 @@ public class QueryElementHolder {
         this.fromLong = new Long(from);
         this.toLong = new Long(to);
     }
+
+    /**
+     * Returns an instance of this class holding the given arguments
+     * such as the candidate class, the filter, etc.
+     * The given arguments represent JDOQL query elements.
+     * It is valid to pass <code>null</code> as a value
+     * for JDOQL querys elements. Such elements are not transfered into a
+     * JDO {@link javax.jdo.Query} instance.
+     * Instead, the default of JDO {@link javax.jdo.Query} instance is taken.
+     * @param unique the JDOQL unique query element
+     * @param result the JDOQL result query element
+     * @param resultClass the JDOQL result class query element
+     * @param candidateClass the JDOQL candidate class query element
+     * @param excludeSubClasses the JDOQL exclude subclasses query element
+     * @param filter the JDOQL filter query element
+     * @param variables the JDOQL variables query element
+     * @param parameters the JDOQL parameters query element
+     * @param imports the JDOQL imports query element
+     * @param grouping the JDOQL grouping query element
+     * @param ordering the JDOQL ordering query element
+     * @param from the JDOQL from query element
+     * @param to the JDOQL to query element
+     */
+    public QueryElementHolder(Boolean unique, String result,
+                              Class resultClass, Class candidateClass,
+                              Boolean excludeSubClasses, String filter,
+                              String variables, String parameters, String imports,
+                              String grouping, String ordering, long from, long to,
+                              JDOQLTypedQuery<?> jdoqlTypedQuery,
+                              Map<String, ?> paramValues) {
+        this.unique = unique;
+        this.result = result;
+        this.resultClass = resultClass;
+        this.candidateClass = candidateClass;
+        this.excludeSubClasses = excludeSubClasses;
+        this.filter = filter;
+        this.variables = variables;
+        this.parameters = parameters;
+        this.imports = imports;
+        this.grouping = grouping;
+        this.ordering = ordering;
+        this.fromLong = new Long(from);
+        this.toLong = new Long(to);
+        this.jdoqlTypedQuery = jdoqlTypedQuery;
+        this.paramValues = paramValues;
+    }
     
     /**
      * Returns the single string JDOQL representation.
@@ -226,7 +327,18 @@ public class QueryElementHolder {
         rangeToAPI(query);
         return query;
     }
-    
+
+    /**
+     * Returns the JDOQLTypedQuery instance.
+     * @return the JDOQLTypedQuery instance
+     */
+    public JDOQLTypedQuery<?> getJDOQLTypedQuery() {
+        if (this.jdoqlTypedQuery != null) {
+            this.rangeToJDOQLTypedQuery(this.jdoqlTypedQuery);
+        }
+        return this.jdoqlTypedQuery;
+    }
+
     /**
      * Returns the unique JDOQL query element.
      * @return the unique JDOQL query element.
@@ -252,6 +364,14 @@ public class QueryElementHolder {
     }
 
     /**
+     * Returns the map of parameter values.
+     * @return the map of parameter values
+     */
+    public Map<String, ?> getParamValues() {
+        return this.paramValues;
+    }
+
+    /**
      * Delegates to {@link QueryElementHolder#toString(String, String)
      * if argument <code>clazz</code> does not equal <code>null</code>,
      * otherwise returns an empty string.
@@ -334,4 +454,17 @@ public class QueryElementHolder {
             query.setRange(this.fromLong.longValue(), this.toLong.longValue());
         }
     }
+
+    /**
+     * Call JDOQLTypedQuery API method {@link javax.jdo.JDOQLTypedQuery#range(long, long)}.
+     * @param query the JDOQLTypedQuery instance
+     */
+    private void rangeToJDOQLTypedQuery(JDOQLTypedQuery query) {
+        if (this.fromString != null && this.toString != null) {
+            query.range(Long.parseLong(this.fromString),  Long.parseLong(this.toString));
+        }
+        else if (this.fromLong != null && this.toLong != null) {
+            query.range(this.fromLong.longValue(), this.toLong.longValue());
+        }
+    }
 }

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/QueryTest.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/QueryTest.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/QueryTest.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/QueryTest.java Sun Nov  4 18:37:24 2018
@@ -29,6 +29,8 @@ import java.util.List;
 import java.util.Map;
 
 import javax.jdo.JDOException;
+import javax.jdo.JDOFatalInternalException;
+import javax.jdo.JDOQLTypedQuery;
 import javax.jdo.JDOUserException;
 import javax.jdo.PersistenceManager;
 import javax.jdo.Query;
@@ -1046,28 +1048,10 @@ public abstract class QueryTest extends
      */
     protected void executeAPIQuery(String assertion,
             QueryElementHolder queryElementHolder, Object expectedResult) {
-        executeAPIQuery(assertion, queryElementHolder, null, expectedResult);
-    }
-
-    /**
-     * Executes the given query element holder instance as a JDO API query.
-     * The result of that query is compared against the given argument 
-     * <code>expectedResult</code>. 
-     * If the expected result does not match the returned query result,
-     * then the test case fails prompting argument <code>assertion</code>.
-     * @param assertion the assertion to prompt if the test case fails.
-     * @param queryElementHolder the query to execute.
-     * @param parameters the parmaters of the query.
-     * @param expectedResult the expected query result.
-     */
-    protected void executeAPIQuery(String assertion,
-            QueryElementHolder queryElementHolder, 
-            Object[] parameters, Object expectedResult) {
         if (logger.isDebugEnabled()) {
             logger.debug("Executing API query: " + queryElementHolder);
         }
-        execute(assertion, queryElementHolder, false, 
-                parameters, expectedResult);
+        execute(assertion, queryElementHolder, false, expectedResult);
     }
     
     /**
@@ -1083,30 +1067,87 @@ public abstract class QueryTest extends
      */
     protected void executeSingleStringQuery(String assertion,
             QueryElementHolder queryElementHolder, Object expectedResult) {
-        executeSingleStringQuery(assertion, queryElementHolder, 
-                null, expectedResult);
+        if (logger.isDebugEnabled())
+            logger.debug("Executing single string query: " +
+                    queryElementHolder);
+        execute(assertion, queryElementHolder, true, expectedResult);
     }
-    
+
     /**
-     * Executes the given query element holder instance 
-     * as a JDO single string query.
-     * The result of that query is compared against the given argument 
-     * <code>expectedResult</code>. 
-     * If the expected result does not match the returned query result,
-     * then the test case fails prompting argument <code>assertion</code>.
-     * @param assertion the assertion to prompt if the test case fails.
-     * @param queryElementHolder the query to execute.
-     * @param parameters the parmaters of the query.
-     * @param expectedResult the expected query result.
+     * 
+     * @param assertion
+     * @param queryElementHolder
+     * @param expectedResult
      */
-    protected void executeSingleStringQuery(String assertion,
-            QueryElementHolder queryElementHolder, 
-            Object[] parameters, Object expectedResult) {
-        if (logger.isDebugEnabled())
-            logger.debug("Executing single string query: " + 
-                    queryElementHolder);
-        execute(assertion, queryElementHolder, true, 
-                parameters, expectedResult);
+    protected void executeJDOQLTypedQuery(String assertion, QueryElementHolder queryElementHolder,
+                                          Object expectedResult) {
+        executeJDOQLTypedQuery(assertion, queryElementHolder, null, expectedResult);
+    }
+
+    /**
+     *
+     * @param assertion
+     * @param queryElementHolder
+     * @param resultClass
+     * @param expectedResult
+     */
+    protected void executeJDOQLTypedQuery(String assertion, QueryElementHolder queryElementHolder,
+                                          Class<?> resultClass, Object expectedResult) {
+        String singleStringQuery = queryElementHolder.toString();
+        getPM();
+        Transaction tx = pm.currentTransaction();
+        tx.begin();
+        try {
+            JDOQLTypedQuery<?> query = queryElementHolder.getJDOQLTypedQuery();
+            if (query == null) {
+                throw new JDOFatalInternalException("Missing JDOQLTyped instance");
+            }
+            Object result = null;
+            try {
+                Map<String, ?> paramValues = queryElementHolder.getParamValues();
+                if (paramValues != null) {
+                    query.setParameters(paramValues);
+                }
+
+                if (resultClass != null) {
+                    if (queryElementHolder.isUnique()) {
+                        // result class specified and unique result
+                        result = query.executeResultUnique(resultClass);
+                    } else {
+                        // result class specified and list result
+                        result = query.executeResultList(resultClass);
+                    }
+                } else {
+                    if (queryElementHolder.isUnique()) {
+                        // no result class and unique result
+                        result = query.executeUnique();
+                    } else {
+                        // no result class and list result
+                        result = query.executeList();
+                    }
+                }
+
+                if (logger.isDebugEnabled()) {
+                    logger.debug("Query result: " + ConversionHelper.
+                            convertObjectArrayElements(result));
+                }
+
+                checkResult(assertion, singleStringQuery, queryElementHolder.hasOrdering(),
+                        result, expectedResult, true);
+            } finally {
+                query.close(result);
+            }
+        } catch (JDOUserException e) {
+            String msg = "JDOUserException thrown while executing query:\n" + singleStringQuery;
+            throw new JDOException(msg, e);
+        } catch (JDOException e) {
+            String msg = "JDOException thrown while executing query:\n" + singleStringQuery;
+            throw new JDOException(msg, e);
+        } finally {
+            if (tx.isActive()) {
+                tx.rollback();
+            }
+        }
     }
 
     /**
@@ -1119,20 +1160,18 @@ public abstract class QueryTest extends
      * @param queryElementHolder the query to execute.
      * @param asSingleString determines if the query is executed as
      * single string query or as API query.
-     * @param parameters the parmaters of the query.
      * @param expectedResult the expected query result.
      * @return the query result
      */
-    private Object execute(String assertion, 
-            QueryElementHolder queryElementHolder, boolean asSingleString,
-            Object parameters, Object expectedResult) {
+    private Object execute(String assertion, QueryElementHolder queryElementHolder,
+                           boolean asSingleString, Object expectedResult) {
         getPM();
         Query query = asSingleString ?
                 queryElementHolder.getSingleStringQuery(pm) :
                     queryElementHolder.getAPIQuery(pm);
         Object result = execute(assertion, query, 
                 queryElementHolder.toString(), 
-                queryElementHolder.hasOrdering(), parameters, 
+                queryElementHolder.hasOrdering(), queryElementHolder.getParamValues(),
                 expectedResult, true);
         return result;
     }
@@ -1285,18 +1324,8 @@ public abstract class QueryTest extends
                         convertObjectArrayElements(result));
                 }
     
-                if (positive) {
-                    if (hasOrdering) {
-                        checkQueryResultWithOrder(assertion, singleStringQuery, result, 
-                                expectedResult);
-                    } else {
-                        checkQueryResultWithoutOrder(assertion, singleStringQuery, result, 
-                                expectedResult);
-                    }
-                } else {
-                    fail(assertion, "Query must throw JDOUserException: " + 
-                            singleStringQuery);
-                }
+                checkResult(assertion, singleStringQuery, hasOrdering, result, expectedResult, positive);
+
             } finally {
                 query.close(result);
             }
@@ -1319,6 +1348,31 @@ public abstract class QueryTest extends
     }
 
     /**
+     * @param assertion the assertion to prompt if the test case fails.
+     * @param singleStringQuery the single string representation of the query.
+     * This parameter is only used as part of the falure message.
+     * @param hasOrdering indicates if the query has an ordering clause.
+     * @param positive indicates if query execution is supposed to fail
+     * @param result the query result.
+     * @param expectedResult the expected query result.
+    */
+    private void checkResult(String assertion, String singleStringQuery, boolean hasOrdering,
+                             Object result, Object expectedResult, boolean positive) {
+        if (positive) {
+            if (hasOrdering) {
+                checkQueryResultWithOrder(assertion, singleStringQuery, result,
+                        expectedResult);
+            } else {
+                checkQueryResultWithoutOrder(assertion, singleStringQuery, result,
+                        expectedResult);
+            }
+        } else {
+            fail(assertion, "Query must throw JDOUserException: " +
+                    singleStringQuery);
+        }
+    }
+
+    /**
      * Converts the given query element holder instance to a
      * JDO query instance.
      * Calls {@link Query#deletePersistentAll()}, or
@@ -1330,18 +1384,16 @@ public abstract class QueryTest extends
      * then the test case fails prompting argument <code>assertion</code>.
      * @param assertion the assertion to prompt if the test case fails.
      * @param queryElementHolder the query to execute.
-     * @param parameters the parmaters of the query.
      * @param expectedNrOfDeletedObjects the expected number of deleted objects.
      */
     protected void deletePersistentAllByAPIQuery(String assertion,
             QueryElementHolder queryElementHolder, 
-            Object parameters, long expectedNrOfDeletedObjects) {
+            long expectedNrOfDeletedObjects) {
         if (logger.isDebugEnabled()) {
             logger.debug("Deleting persistent by API query: " + 
                     queryElementHolder);
         }
-        delete(assertion, queryElementHolder, false, 
-                parameters, expectedNrOfDeletedObjects);
+        delete(assertion, queryElementHolder, false, expectedNrOfDeletedObjects);
     }
     
     /**
@@ -1356,18 +1408,15 @@ public abstract class QueryTest extends
      * then the test case fails prompting argument <code>assertion</code>.
      * @param assertion the assertion to prompt if the test case fails.
      * @param queryElementHolder the query to execute.
-     * @param parameters the parmaters of the query.
      * @param expectedNrOfDeletedObjects the expected number of deleted objects.
      */
     protected void deletePersistentAllBySingleStringQuery(String assertion,
-            QueryElementHolder queryElementHolder, 
-            Object parameters, long expectedNrOfDeletedObjects) {
+            QueryElementHolder queryElementHolder, long expectedNrOfDeletedObjects) {
         if (logger.isDebugEnabled()) {
             logger.debug("Deleting persistent by single string query: " + 
                     queryElementHolder);
         }
-        delete(assertion, queryElementHolder, true, 
-                parameters, expectedNrOfDeletedObjects);
+        delete(assertion, queryElementHolder, true, expectedNrOfDeletedObjects);
     }
 
     /**
@@ -1388,17 +1437,16 @@ public abstract class QueryTest extends
      * @param expectedNrOfDeletedObjects the expected number of deleted objects.
      */
     private void delete(String assertion, 
-            QueryElementHolder queryElementHolder, boolean asSingleString,
-            Object parameters, long expectedNrOfDeletedObjects) {
+            QueryElementHolder queryElementHolder, boolean asSingleString, long expectedNrOfDeletedObjects) {
         getPM();
         Query query = asSingleString ?
                 queryElementHolder.getSingleStringQuery(pm) :
                     queryElementHolder.getAPIQuery(pm);
         delete(assertion, query, queryElementHolder.toString(), 
-                parameters, expectedNrOfDeletedObjects);
+                queryElementHolder.getParamValues(), expectedNrOfDeletedObjects);
         boolean positive = expectedNrOfDeletedObjects >= 0;
         if (positive) {
-            execute(assertion, queryElementHolder, asSingleString, parameters, 
+            execute(assertion, queryElementHolder, asSingleString,
                     queryElementHolder.isUnique() ? null : new ArrayList());
         }
     }

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/delete/DeletePersistentAll.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/delete/DeletePersistentAll.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/delete/DeletePersistentAll.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/delete/DeletePersistentAll.java Sun Nov  4 18:37:24 2018
@@ -23,10 +23,12 @@ import java.util.Map;
 import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.company.CompanyModelReader;
 import org.apache.jdo.tck.pc.company.Insurance;
-import org.apache.jdo.tck.query.QueryElementHolder;
 import org.apache.jdo.tck.query.QueryTest;
 import org.apache.jdo.tck.util.BatchTestRunner;
 
+import javax.jdo.Query;
+import javax.jdo.Transaction;
+
 /**
  *<B>Title:</B> Delete Persistent All.
  *<BR>
@@ -50,41 +52,6 @@ public class DeletePersistentAll extends
     private static final String ASSERTION_FAILED = 
         "Assertion A14.8-1 (DeletePersistentAll) failed: ";
     
-    /** 
-     * The array of valid queries which may be executed as 
-     * single string queries and as API queries.
-     */
-    private static final QueryElementHolder[] VALID_QUERIES = {
-        new QueryElementHolder(
-        /*UNIQUE*/      null,
-        /*RESULT*/      null, 
-        /*INTO*/        null, 
-        /*FROM*/        Insurance.class,
-        /*EXCLUDE*/     null,
-        /*WHERE*/       null,
-        /*VARIABLES*/   null,
-        /*PARAMETERS*/  null,
-        /*IMPORTS*/     null,
-        /*GROUP BY*/    null,
-        /*ORDER BY*/    null,
-        /*FROM*/        null,
-        /*TO*/          null),
-        new QueryElementHolder(
-        /*UNIQUE*/      null,
-        /*RESULT*/      null, 
-        /*INTO*/        null, 
-        /*FROM*/        Insurance.class,
-        /*EXCLUDE*/     null,
-        /*WHERE*/       "carrier == param",
-        /*VARIABLES*/   null,
-        /*PARAMETERS*/  "String param",
-        /*IMPORTS*/     null,
-        /*GROUP BY*/    null,
-        /*ORDER BY*/    null,
-        /*FROM*/        null,
-        /*TO*/          null)
-    };
-    
     /**
      * The <code>main</code> is called when the class
      * is directly executed from the command line.
@@ -93,47 +60,179 @@ public class DeletePersistentAll extends
     public static void main(String[] args) {
         BatchTestRunner.run(DeletePersistentAll.class);
     }
-    
+
     /** */
     public void testNoParametersAPI() {
-        deletePersistentAllByAPIQuery(ASSERTION_FAILED, 
-                VALID_QUERIES[0], null, 11);
+        Transaction tx = pm.currentTransaction();
+        Query<Insurance> query = null;
+        Object result = null;
+        try {
+            tx.begin();
+            String singleStringQuery = "SELECT FROM org.apache.jdo.tck.pc.company.Insurance";
+            query = pm.newQuery(Insurance.class);
+            long expectedNrOfDeletedObjects = 11;
+            long nr = query.deletePersistentAll();
+            if (nr != expectedNrOfDeletedObjects) {
+                fail(ASSERTION_FAILED, "deletePersistentAll returned " + nr +
+                        ", expected is " + expectedNrOfDeletedObjects +
+                        ". Query: " + singleStringQuery);
+            }
+            tx.commit();
+        } finally {
+            if (query != null) {
+                query.close(result);
+            }
+            if (tx.isActive()) {
+                tx.rollback();
+            }
+        }
     }
     
     /** */
     public void testNoParametersSingleString() {
-        deletePersistentAllBySingleStringQuery(ASSERTION_FAILED, 
-                VALID_QUERIES[0], null, 11);
+        Transaction tx = pm.currentTransaction();
+        Query<Insurance> query = null;
+        Object result = null;
+        try {
+            tx.begin();
+            String singleStringQuery = "SELECT FROM org.apache.jdo.tck.pc.company.Insurance";
+            query = pm.newQuery(singleStringQuery);
+            long expectedNrOfDeletedObjects = 11;
+            long nr = query.deletePersistentAll();
+            if (nr != expectedNrOfDeletedObjects) {
+                fail(ASSERTION_FAILED, "deletePersistentAll returned " + nr +
+                        ", expected is " + expectedNrOfDeletedObjects +
+                        ". Query: " + singleStringQuery);
+            }
+            tx.commit();
+        } finally {
+            if (query != null) {
+                query.close(result);
+            }
+            if (tx.isActive()) {
+                tx.rollback();
+            }
+        }
     }
     
     /** */
     public void testObjectArrayParametersAPI() {
-        Object[] parameters = new Object[] {"Carrier1"};
-        deletePersistentAllByAPIQuery(ASSERTION_FAILED, 
-                VALID_QUERIES[1], parameters, 2);
+        Transaction tx = pm.currentTransaction();
+        Query<Insurance> query = null;
+        Object result = null;
+        try {
+            tx.begin();
+            String singleStringQuery = "SELECT FROM org.apache.jdo.tck.pc.company.Insurance " +
+                                       "WHERE carrier == param PARAMETERS String param";
+            query = pm.newQuery(Insurance.class, "carrier == param");
+            query.declareParameters("String param");
+            Object[] parameters = new Object[] {"Carrier1"};
+            long expectedNrOfDeletedObjects = 2;
+            long nr = query.deletePersistentAll(parameters);
+            if (nr != expectedNrOfDeletedObjects) {
+                fail(ASSERTION_FAILED, "deletePersistentAll returned " + nr +
+                        ", expected is " + expectedNrOfDeletedObjects +
+                        ". Query: " + singleStringQuery);
+            }
+            tx.commit();
+        } finally {
+            if (query != null) {
+                query.close(result);
+            }
+            if (tx.isActive()) {
+                tx.rollback();
+            }
+        }
     }
     
     /** */
     public void testObjectArrayParametersSingleString() {
-        Object[] parameters = new Object[] {"Carrier1"};
-        deletePersistentAllBySingleStringQuery(ASSERTION_FAILED, 
-                VALID_QUERIES[1], parameters, 2);
+        Transaction tx = pm.currentTransaction();
+        Query<Insurance> query = null;
+        Object result = null;
+        try {
+            tx.begin();
+            String singleStringQuery = "SELECT FROM org.apache.jdo.tck.pc.company.Insurance " +
+                                       "WHERE carrier == param PARAMETERS String param";
+            query = pm.newQuery(singleStringQuery);
+            Object[] parameters = new Object[] {"Carrier1"};
+            long expectedNrOfDeletedObjects = 2;
+            long nr = query.deletePersistentAll(parameters);
+            if (nr != expectedNrOfDeletedObjects) {
+                fail(ASSERTION_FAILED, "deletePersistentAll returned " + nr +
+                        ", expected is " + expectedNrOfDeletedObjects +
+                        ". Query: " + singleStringQuery);
+            }
+            tx.commit();
+        } finally {
+            if (query != null) {
+                query.close(result);
+            }
+            if (tx.isActive()) {
+                tx.rollback();
+            }
+        }
     }
     
     /** */
     public void testMapParametersAPI() {
-        Map parameters = new HashMap();
-        parameters.put("param", "Carrier1");
-        deletePersistentAllByAPIQuery(ASSERTION_FAILED, 
-                VALID_QUERIES[1], parameters, 2);
+        Transaction tx = pm.currentTransaction();
+        Query<Insurance> query = null;
+        Object result = null;
+        try {
+            tx.begin();
+            String singleStringQuery = "SELECT FROM org.apache.jdo.tck.pc.company.Insurance " +
+                                       "WHERE carrier == param PARAMETERS String param";
+            query = pm.newQuery(Insurance.class, "carrier == param");
+            query.declareParameters("String param");
+            Map parameters = new HashMap();
+            parameters.put("param", "Carrier1");
+            long expectedNrOfDeletedObjects = 2;
+            long nr = query.deletePersistentAll(parameters);
+            if (nr != expectedNrOfDeletedObjects) {
+                fail(ASSERTION_FAILED, "deletePersistentAll returned " + nr +
+                        ", expected is " + expectedNrOfDeletedObjects +
+                        ". Query: " + singleStringQuery);
+            }
+            tx.commit();
+        } finally {
+            if (query != null) {
+                query.close(result);
+            }
+            if (tx.isActive()) {
+                tx.rollback();
+            }
+        }
     }
     
     /** */
     public void testMapParametersSingleString() {
-        Map parameters = new HashMap();
-        parameters.put("param", "Carrier1");
-        deletePersistentAllBySingleStringQuery(ASSERTION_FAILED, 
-                VALID_QUERIES[1], parameters, 2);
+        Transaction tx = pm.currentTransaction();
+        Query<Insurance> query = null;
+        Object result = null;
+        try {
+            tx.begin();
+            String singleStringQuery = "SELECT FROM org.apache.jdo.tck.pc.company.Insurance " +
+                                       "WHERE carrier == param PARAMETERS String param";
+            query = pm.newQuery(singleStringQuery);
+            Map parameters = new HashMap();
+            parameters.put("param", "Carrier1");
+            long expectedNrOfDeletedObjects = 2;
+            long nr = query.deletePersistentAll(parameters);
+            if (nr != expectedNrOfDeletedObjects) {
+                fail(ASSERTION_FAILED, "deletePersistentAll returned " + nr +
+                        ", expected is " + expectedNrOfDeletedObjects +
+                        ". Query: " + singleStringQuery);
+            }
+            tx.commit();
+        } finally {
+            if (query != null) {
+                query.close(result);
+            }
+            if (tx.isActive()) {
+                tx.rollback();
+            }
+        }
     }
     
     /**

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/delete/DeleteQueryElements.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/delete/DeleteQueryElements.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/delete/DeleteQueryElements.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/delete/DeleteQueryElements.java Sun Nov  4 18:37:24 2018
@@ -18,15 +18,15 @@
 package org.apache.jdo.tck.query.delete;
 
 import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.company.CompanyModelReader;
 import org.apache.jdo.tck.pc.company.DentalInsurance;
-import org.apache.jdo.tck.pc.company.FullTimeEmployee;
 import org.apache.jdo.tck.pc.company.Insurance;
 import org.apache.jdo.tck.query.QueryElementHolder;
 import org.apache.jdo.tck.query.QueryTest;
-import org.apache.jdo.tck.query.result.classes.FullName;
 import org.apache.jdo.tck.util.BatchTestRunner;
 
 /**
@@ -51,29 +51,6 @@ public class DeleteQueryElements extends
         "Assertion A14.8-1 (DeleteQueryElements) failed: ";
     
     /** 
-     * The array of valid queries which may be executed as 
-     * single string queries and as API queries.
-     */
-    private static final QueryElementHolder[] VALID_QUERIES = {
-        new QueryElementHolder(
-        /*UNIQUE*/      Boolean.TRUE,
-        /*RESULT*/      null, 
-        /*INTO*/        null, 
-        /*FROM*/        DentalInsurance.class,
-        /*EXCLUDE*/     null,
-        /*WHERE*/       "((FullTimeEmployee)employee).salary > 10000 & " +
-                        "employee.projects.contains(p) & p.budget > limit",
-        /*VARIABLES*/   "Project p",
-        /*PARAMETERS*/  "BigDecimal limit",
-        /*IMPORTS*/     "import org.apache.jdo.tck.pc.company.Project; " +
-                        "import java.math.BigDecimal;",
-        /*GROUP BY*/    null,
-        /*ORDER BY*/    null,
-        /*FROM*/        null,
-        /*TO*/          null)
-    };
-    
-    /** 
      * The array of invalid queries which may be executed as 
      * single string queries and as API queries.
      */
@@ -220,25 +197,63 @@ public class DeleteQueryElements extends
     
     /** */
     public void testAPI() {
-        int index = 0;
-        deletePersistentAllByAPIQuery(ASSERTION_FAILED, 
-                VALID_QUERIES[index], parameters[index], 1);
+        Map<String, Object> paramValues = new HashMap<>();
+        paramValues.put("limit", new BigDecimal("2500000"));
+
+        QueryElementHolder holder = new QueryElementHolder(
+                /*UNIQUE*/      Boolean.TRUE,
+                /*RESULT*/      null,
+                /*INTO*/        null,
+                /*FROM*/        DentalInsurance.class,
+                /*EXCLUDE*/     null,
+                /*WHERE*/       "((FullTimeEmployee)employee).salary > 10000 & " +
+                "employee.projects.contains(p) & p.budget > limit",
+                /*VARIABLES*/   "Project p",
+                /*PARAMETERS*/  "BigDecimal limit",
+                /*IMPORTS*/     "import org.apache.jdo.tck.pc.company.Project; " +
+                "import java.math.BigDecimal;",
+                /*GROUP BY*/    null,
+                /*ORDER BY*/    null,
+                /*FROM*/        null,
+                /*TO*/          null,
+                /*JDOQLTyped*/  null,
+                /*paramValues*/ paramValues);
+
+        deletePersistentAllByAPIQuery(ASSERTION_FAILED, holder, 1);
     }
     
     /** */
     public void testSingleString() {
-        int index = 0;
-        deletePersistentAllBySingleStringQuery(ASSERTION_FAILED, 
-                VALID_QUERIES[index], parameters[index], 1);
+        Map<String, Object> paramValues = new HashMap<>();
+        paramValues.put("limit", new BigDecimal("2500000"));
+
+        QueryElementHolder holder = new QueryElementHolder(
+                /*UNIQUE*/      Boolean.TRUE,
+                /*RESULT*/      null,
+                /*INTO*/        null,
+                /*FROM*/        DentalInsurance.class,
+                /*EXCLUDE*/     null,
+                /*WHERE*/       "((FullTimeEmployee)employee).salary > 10000 & " +
+                "employee.projects.contains(p) & p.budget > limit",
+                /*VARIABLES*/   "Project p",
+                /*PARAMETERS*/  "BigDecimal limit",
+                /*IMPORTS*/     "import org.apache.jdo.tck.pc.company.Project; " +
+                "import java.math.BigDecimal;",
+                /*GROUP BY*/    null,
+                /*ORDER BY*/    null,
+                /*FROM*/        null,
+                /*TO*/          null,
+                /*JDOQLTyped*/  null,
+                /*paramValues*/ paramValues);
+
+        deletePersistentAllBySingleStringQuery(ASSERTION_FAILED, holder,1);
     }
     
     /** */
     public void testNegative() {
         for (int i = 0; i < INVALID_QUERIES.length; i++) {
-            deletePersistentAllByAPIQuery(ASSERTION_FAILED, 
-                    INVALID_QUERIES[i], null, -1);
-            deletePersistentAllBySingleStringQuery(ASSERTION_FAILED, 
-                    INVALID_QUERIES[i], null, -1);
+            deletePersistentAllByAPIQuery(ASSERTION_FAILED, INVALID_QUERIES[i], -1);
+            deletePersistentAllBySingleStringQuery(ASSERTION_FAILED, INVALID_QUERIES[i], -1);
         }
     }
     

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/Cast.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/Cast.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/Cast.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/Cast.java Sun Nov  4 18:37:24 2018
@@ -21,10 +21,17 @@ import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.company.CompanyModelReader;
 import org.apache.jdo.tck.pc.company.Department;
 import org.apache.jdo.tck.pc.company.Employee;
+import org.apache.jdo.tck.pc.company.FullTimeEmployee;
+import org.apache.jdo.tck.pc.company.QDepartment;
+import org.apache.jdo.tck.pc.company.QEmployee;
+import org.apache.jdo.tck.pc.company.QFullTimeEmployee;
 import org.apache.jdo.tck.query.QueryElementHolder;
 import org.apache.jdo.tck.query.QueryTest;
 import org.apache.jdo.tck.util.BatchTestRunner;
 
+import javax.jdo.JDOQLTypedQuery;
+import javax.jdo.query.Expression;
+
 /**
  *<B>Title:</B> Cast Query Operator
  *<BR>
@@ -43,49 +50,6 @@ public class Cast extends QueryTest {
     private static final String ASSERTION_FAILED = 
         "Assertion A14.6.2-38 (Cast) failed: ";
     
-    /** 
-     * The array of valid queries which may be executed as 
-     * single string queries and as API queries.
-     */
-    private static final QueryElementHolder[] VALID_QUERIES = {
-        new QueryElementHolder(
-        /*UNIQUE*/      null,
-        /*RESULT*/      null,
-        /*INTO*/        null, 
-        /*FROM*/        Employee.class,
-        /*EXCLUDE*/     null,
-        /*WHERE*/       "((FullTimeEmployee)this).salary > 15000.0",
-        /*VARIABLES*/   null,
-        /*PARAMETERS*/  null,
-        /*IMPORTS*/     "import org.apache.jdo.tck.pc.company.FullTimeEmployee",
-        /*GROUP BY*/    null,
-        /*ORDER BY*/    null,
-        /*FROM*/        null,
-        /*TO*/          null),
-        new QueryElementHolder(
-        /*UNIQUE*/      null,
-        /*RESULT*/      null,
-        /*INTO*/        null, 
-        /*FROM*/        Department.class,
-        /*EXCLUDE*/     null,
-        /*WHERE*/       "employees.contains(e) && ((FullTimeEmployee)e).salary > 15000.0",
-        /*VARIABLES*/   "Employee e",
-        /*PARAMETERS*/  null,
-        /*IMPORTS*/     "import org.apache.jdo.tck.pc.company.FullTimeEmployee",
-        /*GROUP BY*/    null,
-        /*ORDER BY*/    null,
-        /*FROM*/        null,
-        /*TO*/          null)
-    };
-        
-    /** 
-     * The expected results of valid queries.
-     */
-    private Object[] expectedResult = {
-        getTransientCompanyModelInstancesAsList(new String[]{"emp1", "emp5"}),
-        getTransientCompanyModelInstancesAsList(new String[]{"dept1", "dept2"})
-    };
-    
     /**
      * The <code>main</code> is called when the class
      * is directly executed from the command line.
@@ -96,13 +60,70 @@ public class Cast extends QueryTest {
     }
     
     /** */
-    public void testPositive() {
-        for (int i = 0; i < VALID_QUERIES.length; i++) {
-            executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResult[i]);
-            executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResult[i]);
-        }
+    public void testPositive0() {
+        Object expected = getTransientCompanyModelInstancesAsList(new String[]{"emp1", "emp5"});
+
+        JDOQLTypedQuery<Employee> query = getPM().newJDOQLTypedQuery(Employee.class);
+        QEmployee cand = QEmployee.candidate();
+        // DataNucleus: UnsupportedOperationException: cast not yet supported
+        //QFullTimeEmployee cast = (QFullTimeEmployee)cand.cast(FullTimeEmployee.class);
+        //query.filter(cast.salary.gt(15000.0));
+
+        QueryElementHolder holder = new QueryElementHolder(
+                /*UNIQUE*/      null,
+                /*RESULT*/      null,
+                /*INTO*/        null,
+                /*FROM*/        Employee.class,
+                /*EXCLUDE*/     null,
+                /*WHERE*/       "((FullTimeEmployee)this).salary > 15000.0",
+                /*VARIABLES*/   null,
+                /*PARAMETERS*/  null,
+                /*IMPORTS*/     "import org.apache.jdo.tck.pc.company.FullTimeEmployee",
+                /*GROUP BY*/    null,
+                /*ORDER BY*/    null,
+                /*FROM*/        null,
+                /*TO*/          null,
+                /*JDOQLTyped*/  query,
+                /*paramValues*/ null);
+
+        executeAPIQuery(ASSERTION_FAILED, holder, expected);
+        executeSingleStringQuery(ASSERTION_FAILED, holder, expected);
+        // DataNucleus: UnsupportedOperationException: cast not yet supported
+        //executeJDOQLTypedQuery(ASSERTION_FAILED, holder, expected);
+    }
+
+    /** */
+    public void testPositive1() {
+        Object expected = getTransientCompanyModelInstancesAsList(new String[]{"dept1", "dept2"});
+
+        JDOQLTypedQuery<Department> query = getPM().newJDOQLTypedQuery(Department.class);
+        QDepartment cand = QDepartment.candidate();
+        QEmployee e = QEmployee.variable("e");
+        // DataNucleus: UnsupportedOperationException: cast not yet supported
+        //QFullTimeEmployee cast = (QFullTimeEmployee)cand.cast(FullTimeEmployee.class);
+        //query.filter(cand.employees.contains(e).and(cast.salary.gt(15000.0)));
+
+        QueryElementHolder holder = new QueryElementHolder(
+                /*UNIQUE*/      null,
+                /*RESULT*/      null,
+                /*INTO*/        null,
+                /*FROM*/        Department.class,
+                /*EXCLUDE*/     null,
+                /*WHERE*/       "employees.contains(e) && ((FullTimeEmployee)e).salary > 15000.0",
+                /*VARIABLES*/   "Employee e",
+                /*PARAMETERS*/  null,
+                /*IMPORTS*/     "import org.apache.jdo.tck.pc.company.FullTimeEmployee",
+                /*GROUP BY*/    null,
+                /*ORDER BY*/    null,
+                /*FROM*/        null,
+                /*TO*/          null,
+                /*JDOQLTyped*/  null,
+                /*paramValues*/ null);
+
+        executeAPIQuery(ASSERTION_FAILED, holder, expected);
+        executeSingleStringQuery(ASSERTION_FAILED, holder, expected);
+        // DataNucleus: UnsupportedOperationException: cast not yet supported
+        //executeJDOQLTypedQuery(ASSERTION_FAILED, holder, expected);
     }
     
     /**

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/CharacterAndStringLiterals.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/CharacterAndStringLiterals.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/CharacterAndStringLiterals.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/CharacterAndStringLiterals.java Sun Nov  4 18:37:24 2018
@@ -20,10 +20,13 @@ package org.apache.jdo.tck.query.jdoql;
 import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.mylib.MylibReader;
 import org.apache.jdo.tck.pc.mylib.PrimitiveTypes;
+import org.apache.jdo.tck.pc.mylib.QPrimitiveTypes;
 import org.apache.jdo.tck.query.QueryElementHolder;
 import org.apache.jdo.tck.query.QueryTest;
 import org.apache.jdo.tck.util.BatchTestRunner;
 
+import javax.jdo.JDOQLTypedQuery;
+
 /**
  *<B>Title:</B> Character and String Literals.
  *<BR>
@@ -80,49 +83,6 @@ public class CharacterAndStringLiterals
         /*TO*/          null)
     };
     
-    /** 
-     * The array of valid queries which may be executed as 
-     * single string queries and as API queries.
-     */
-    private static final QueryElementHolder[] VALID_QUERIES = {
-        new QueryElementHolder(
-        /*UNIQUE*/      null,
-        /*RESULT*/      null, 
-        /*INTO*/        null, 
-        /*FROM*/        PrimitiveTypes.class,
-        /*EXCLUDE*/     null,
-        /*WHERE*/       "stringNull.startsWith('Even') || charNotNull == 'O'",
-        /*VARIABLES*/   null,
-        /*PARAMETERS*/  null,
-        /*IMPORTS*/     null,
-        /*GROUP BY*/    null,
-        /*ORDER BY*/    null,
-        /*FROM*/        null,
-        /*TO*/          null),
-        new QueryElementHolder(
-        /*UNIQUE*/      null,
-        /*RESULT*/      null, 
-        /*INTO*/        null, 
-        /*FROM*/        PrimitiveTypes.class,
-        /*EXCLUDE*/     null,
-        /*WHERE*/       "stringNull.startsWith(\"Even\") || charNotNull == \"O\"",
-        /*VARIABLES*/   null,
-        /*PARAMETERS*/  null,
-        /*IMPORTS*/     null,
-        /*GROUP BY*/    null,
-        /*ORDER BY*/    null,
-        /*FROM*/        null,
-        /*TO*/          null)
-    };
-    
-    /** 
-     * The expected results of valid queries.
-     */
-    private Object[] expectedResult = {
-        getTransientMylibInstancesAsList(new String[]{
-            "primitiveTypesCharacterStringLiterals"})
-    };
-    
     /**
      * The <code>main</code> is called when the class
      * is directly executed from the command line.
@@ -131,17 +91,71 @@ public class CharacterAndStringLiterals
     public static void main(String[] args) {
         BatchTestRunner.run(CharacterAndStringLiterals.class);
     }
-    
-    /** */
-    public void testPositive() {
-        if (isUnconstrainedVariablesSupported()) {
-            for (int i = 0; i < VALID_QUERIES.length; i++) {
-                executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                        expectedResult[i]);
-                executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                        expectedResult[i]);
-            }
-        }
+
+    /**
+     *
+     */
+    public void testPositive1() {
+        Object expected = getTransientMylibInstancesAsList(new String[]{
+                        "primitiveTypesCharacterStringLiterals"});
+
+        JDOQLTypedQuery<PrimitiveTypes> query = getPM().newJDOQLTypedQuery(PrimitiveTypes.class);
+        QPrimitiveTypes cand = QPrimitiveTypes.candidate();
+        query.filter(cand.stringNull.startsWith("Even").or(cand.charNotNull.eq('0')));
+
+        QueryElementHolder holder = new QueryElementHolder(
+                /*UNIQUE*/      null,
+                /*RESULT*/      null,
+                /*INTO*/        null,
+                /*FROM*/        PrimitiveTypes.class,
+                /*EXCLUDE*/     null,
+                /*WHERE*/       "stringNull.startsWith('Even') || charNotNull == 'O'",
+                /*VARIABLES*/   null,
+                /*PARAMETERS*/  null,
+                /*IMPORTS*/     null,
+                /*GROUP BY*/    null,
+                /*ORDER BY*/    null,
+                /*FROM*/        null,
+                /*TO*/          null,
+                /*JDOQLTyped*/  query,
+                /*paramValues*/ null);
+
+        executeAPIQuery(ASSERTION_FAILED, holder, expected);
+        executeSingleStringQuery(ASSERTION_FAILED, holder, expected);
+        executeJDOQLTypedQuery(ASSERTION_FAILED, holder, expected);
+    }
+
+    /**
+     * 
+     */
+    public void testPositive2() {
+        Object expected = getTransientMylibInstancesAsList(new String[]{
+                "primitiveTypesCharacterStringLiterals"});
+
+        JDOQLTypedQuery<PrimitiveTypes> query = getPM().newJDOQLTypedQuery(PrimitiveTypes.class);
+        QPrimitiveTypes cand = QPrimitiveTypes.candidate();
+        query.filter(cand.stringNull.startsWith("Even").or(cand.charNotNull.eq('0')));
+
+        QueryElementHolder holder = new QueryElementHolder(
+                /*UNIQUE*/      null,
+                /*RESULT*/      null,
+                /*INTO*/        null,
+                /*FROM*/        PrimitiveTypes.class,
+                /*EXCLUDE*/     null,
+                /*WHERE*/       "stringNull.startsWith(\"Even\") || charNotNull == \"O\"",
+                /*VARIABLES*/   null,
+                /*PARAMETERS*/  null,
+                /*IMPORTS*/     null,
+                /*GROUP BY*/    null,
+                /*ORDER BY*/    null,
+                /*FROM*/        null,
+                /*TO*/          null,
+                /*JDOQLTyped*/  query,
+                /*paramValues*/ null);
+
+        executeAPIQuery(ASSERTION_FAILED, holder, expected);
+        executeSingleStringQuery(ASSERTION_FAILED, holder, expected);
+        executeJDOQLTypedQuery(ASSERTION_FAILED, holder, expected);
     }
 
     /** */

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/ComparingCollectionFieldToNull.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/ComparingCollectionFieldToNull.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/ComparingCollectionFieldToNull.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/ComparingCollectionFieldToNull.java Sun Nov  4 18:37:24 2018
@@ -20,10 +20,15 @@ package org.apache.jdo.tck.query.jdoql;
 import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.company.CompanyModelReader;
 import org.apache.jdo.tck.pc.company.Employee;
+import org.apache.jdo.tck.pc.company.QEmployee;
 import org.apache.jdo.tck.query.QueryElementHolder;
 import org.apache.jdo.tck.query.QueryTest;
 import org.apache.jdo.tck.util.BatchTestRunner;
 
+import javax.jdo.JDOQLTypedQuery;
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  *<B>Title:</B> Comparing a Collection Field to Null
  *<BR>
@@ -46,30 +51,9 @@ public class ComparingCollectionFieldToN
         "Assertion A14.6.2-36 (ComparingCollectionFieldToNull) failed: ";
     
     /** 
-     * The array of valid queries which may be executed as 
-     * single string queries and as API queries.
-     */
-    private static final QueryElementHolder[] VALID_QUERIES = {
-        new QueryElementHolder(
-        /*UNIQUE*/      null,
-        /*RESULT*/      null,
-        /*INTO*/        null, 
-        /*FROM*/        Employee.class,
-        /*EXCLUDE*/     null,
-        /*WHERE*/       "personid == 1 && projects == null",
-        /*VARIABLES*/   null,
-        /*PARAMETERS*/  null,
-        /*IMPORTS*/     null,
-        /*GROUP BY*/    null,
-        /*ORDER BY*/    null,
-        /*FROM*/        null,
-        /*TO*/          null)
-    };
-    
-    /** 
      * The expected results of valid queries.
      */
-    private Object[] expectedResult;
+    private List<Employee> expectedResult;
     
     /**
      * The <code>main</code> is called when the class
@@ -82,12 +66,30 @@ public class ComparingCollectionFieldToN
     
     /** */
     public void testPositive() {
-        for (int i = 0; i < VALID_QUERIES.length; i++) {
-            executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResult[i]);
-            executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResult[i]);
-        }
+        JDOQLTypedQuery<Employee> query = getPM().newJDOQLTypedQuery(Employee.class);
+        QEmployee cand = QEmployee.candidate();
+        query.filter(cand.personid.eq(1L).and(cand.projects.eq(null)));
+
+        QueryElementHolder holder = new QueryElementHolder(
+                /*UNIQUE*/      null,
+                /*RESULT*/      null,
+                /*INTO*/        null,
+                /*FROM*/        Employee.class,
+                /*EXCLUDE*/     null,
+                /*WHERE*/       "personid == 1 && projects == null",
+                /*VARIABLES*/   null,
+                /*PARAMETERS*/  null,
+                /*IMPORTS*/     null,
+                /*GROUP BY*/    null,
+                /*ORDER BY*/    null,
+                /*FROM*/        null,
+                /*TO*/          null,
+                /*JDOQLTyped*/  query,
+                /*paramValues*/ null);
+
+        executeAPIQuery(ASSERTION_FAILED, holder, expectedResult);
+        executeSingleStringQuery(ASSERTION_FAILED, holder, expectedResult);
+        executeJDOQLTypedQuery(ASSERTION_FAILED, holder, expectedResult);
     }
     
     /**
@@ -97,13 +99,12 @@ public class ComparingCollectionFieldToN
         addTearDownClass(CompanyModelReader.getTearDownClasses());
         loadAndPersistCompanyModel(getPM());
         Employee employee = (Employee) getPersistentCompanyModelInstance("emp1");
-        expectedResult = new Object[] {
+        expectedResult =
             // emp1 should be in the query result set,
             // if the JDO Implentation supports null values for Collections
             getTransientCompanyModelInstancesAsList(
                 isNullCollectionSupported() ? 
-                    new String[]{"emp1"} : new String[]{})
-        };
+                    new String[]{"emp1"} : new String[]{});
         if (isNullCollectionSupported()) {
             getPM().currentTransaction().begin();
             employee.setProjects(null);

Modified: db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/ComparingPersistentAndNonPersistentInstance.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/ComparingPersistentAndNonPersistentInstance.java?rev=1845744&r1=1845743&r2=1845744&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/ComparingPersistentAndNonPersistentInstance.java (original)
+++ db/jdo/trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/ComparingPersistentAndNonPersistentInstance.java Sun Nov  4 18:37:24 2018
@@ -20,10 +20,16 @@ package org.apache.jdo.tck.query.jdoql;
 import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.company.CompanyModelReader;
 import org.apache.jdo.tck.pc.company.Employee;
+import org.apache.jdo.tck.pc.company.QEmployee;
 import org.apache.jdo.tck.query.QueryElementHolder;
 import org.apache.jdo.tck.query.QueryTest;
 import org.apache.jdo.tck.util.BatchTestRunner;
 
+import javax.jdo.JDOQLTypedQuery;
+import javax.jdo.query.Expression;
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  *<B>Title:</B> Comparing persistent and non-persistent instance
  *<BR>
@@ -42,55 +48,6 @@ public class ComparingPersistentAndNonPe
     /** */
     private static final String ASSERTION_FAILED = 
         "Assertion A14.6.2-44 (ComparingPersistentAndNonPersistentInstance) failed: ";
-    
-    /** 
-     * The array of valid queries which may be executed as 
-     * single string queries and as API queries.
-     */
-    private static final QueryElementHolder[] VALID_QUERIES = {
-        new QueryElementHolder(
-        /*UNIQUE*/      null,
-        /*RESULT*/      null,
-        /*INTO*/        null, 
-        /*FROM*/        Employee.class,
-        /*EXCLUDE*/     null,
-        /*WHERE*/       "this == param",
-        /*VARIABLES*/   null,
-        /*PARAMETERS*/  "Employee param",
-        /*IMPORTS*/     null,
-        /*GROUP BY*/    null,
-        /*ORDER BY*/    null,
-        /*FROM*/        null,
-        /*TO*/          null),
-        new QueryElementHolder(
-        /*UNIQUE*/      null,
-        /*RESULT*/      null,
-        /*INTO*/        null, 
-        /*FROM*/        Employee.class,
-        /*EXCLUDE*/     null,
-        /*WHERE*/       "this.personid == param.personid",
-        /*VARIABLES*/   null,
-        /*PARAMETERS*/  "Employee param",
-        /*IMPORTS*/     null,
-        /*GROUP BY*/    null,
-        /*ORDER BY*/    null,
-        /*FROM*/        null,
-        /*TO*/          null)
-    };
-    
-    /** 
-     * The expected results of valid queries.
-     */
-    private Object[] expectedResult = {
-            getTransientCompanyModelInstancesAsList(new String[]{}),
-            getTransientCompanyModelInstancesAsList(new String[]{"emp1"})
-    };
-    
-    /** Parameters of valid queries. */
-    private Object[][] parameters = {
-        {getTransientCompanyModelInstance("emp1")},
-        {getTransientCompanyModelInstance("emp1")}
-    };
             
     /**
      * The <code>main</code> is called when the class
@@ -100,15 +57,74 @@ public class ComparingPersistentAndNonPe
     public static void main(String[] args) {
         BatchTestRunner.run(ComparingPersistentAndNonPersistentInstance.class);
     }
-    
+
     /** */
-    public void testPositive() {
-        for (int i = 0; i < VALID_QUERIES.length; i++) {
-            executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    parameters[i], expectedResult[i]);
-            executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    parameters[i], expectedResult[i]);
-        }
+    public void testPositive0() {
+        Object expected = getTransientCompanyModelInstancesAsList(new String[]{});
+
+        JDOQLTypedQuery<Employee> query = getPM().newJDOQLTypedQuery(Employee.class);
+        QEmployee cand = QEmployee.candidate();
+        Expression<Employee> empParam = query.parameter("param", Employee.class);
+        query.filter(cand.eq(empParam));
+
+        Map<String, Object> paramValues = new HashMap<>();
+        paramValues.put("param", getTransientCompanyModelInstance("emp1"));
+
+        QueryElementHolder holder = new QueryElementHolder(
+                /*UNIQUE*/      null,
+                /*RESULT*/      null,
+                /*INTO*/        null,
+                /*FROM*/        Employee.class,
+                /*EXCLUDE*/     null,
+                /*WHERE*/       "this == param",
+                /*VARIABLES*/   null,
+                /*PARAMETERS*/  "Employee param",
+                /*IMPORTS*/     null,
+                /*GROUP BY*/    null,
+                /*ORDER BY*/    null,
+                /*FROM*/        null,
+                /*TO*/          null,
+                /*JDOQLTyped*/  query,
+                /*paramValues*/ paramValues);
+
+        executeAPIQuery(ASSERTION_FAILED, holder, expected);
+        executeSingleStringQuery(ASSERTION_FAILED, holder, expected);
+        executeJDOQLTypedQuery(ASSERTION_FAILED, holder, expected);
+    }
+
+    /** */
+    public void testPositive1() {
+        Object expected = getTransientCompanyModelInstancesAsList(new String[]{"emp1"});
+
+        JDOQLTypedQuery<Employee> query = getPM().newJDOQLTypedQuery(Employee.class);
+        QEmployee cand = QEmployee.candidate();
+        Expression<Employee> empParamExpression = query.parameter("param", Employee.class);
+        QEmployee empParam = QEmployee.parameter("param");
+        query.filter(cand.personid.eq(empParam.personid));
+
+        Map<String, Object> paramValues = new HashMap<>();
+        paramValues.put("param", getTransientCompanyModelInstance("emp1"));
+
+        QueryElementHolder holder = new QueryElementHolder(
+                /*UNIQUE*/      null,
+                /*RESULT*/      null,
+                /*INTO*/        null,
+                /*FROM*/        Employee.class,
+                /*EXCLUDE*/     null,
+                /*WHERE*/       "this.personid == param.personid",
+                /*VARIABLES*/   null,
+                /*PARAMETERS*/  "Employee param",
+                /*IMPORTS*/     null,
+                /*GROUP BY*/    null,
+                /*ORDER BY*/    null,
+                /*FROM*/        null,
+                /*TO*/          null,
+                /*JDOQLTyped*/  query,
+                /*paramValues*/ paramValues);
+
+        executeAPIQuery(ASSERTION_FAILED, holder, expected);
+        executeSingleStringQuery(ASSERTION_FAILED, holder, expected);
+        executeJDOQLTypedQuery(ASSERTION_FAILED, holder, expected);
     }
     
     /**



Mime
View raw message