db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r1804869 - in /db/jdo/trunk: specification/OOO/ tck/src/java/org/apache/jdo/tck/query/api/ tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/company/ tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/
Date Sat, 12 Aug 2017 18:11:59 GMT
Author: mbo
Date: Sat Aug 12 18:11:58 2017
New Revision: 1804869

URL: http://svn.apache.org/viewvc?rev=1804869&view=rev
Log:
JDO-761: named queries using CDATA syntax

Modified:
    db/jdo/trunk/specification/OOO/Ch14-Query.odt
    db/jdo/trunk/tck/src/java/org/apache/jdo/tck/query/api/SampleQueries.java
    db/jdo/trunk/tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/company/package.jdo
    db/jdo/trunk/tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/package.jdo

Modified: db/jdo/trunk/specification/OOO/Ch14-Query.odt
URL: http://svn.apache.org/viewvc/db/jdo/trunk/specification/OOO/Ch14-Query.odt?rev=1804869&r1=1804868&r2=1804869&view=diff
==============================================================================
Binary files - no diff available.

Modified: db/jdo/trunk/tck/src/java/org/apache/jdo/tck/query/api/SampleQueries.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/java/org/apache/jdo/tck/query/api/SampleQueries.java?rev=1804869&r1=1804868&r2=1804869&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/java/org/apache/jdo/tck/query/api/SampleQueries.java (original)
+++ db/jdo/trunk/tck/src/java/org/apache/jdo/tck/query/api/SampleQueries.java Sat Aug 12 18:11:58
2017
@@ -1093,7 +1093,7 @@ public class SampleQueries extends Query
                     "select new org.apache.jdo.tck.query.api.SampleQueries$Info (firstname,
salary, manager) " +
                             "from org.apache.jdo.tck.pc.company.FullTimeEmployee " +
                             "where department.name == :deptName";
-            Query<FullTimeEmployee> q = pm.newNamedQuery(FullTimeEmployee.class, "construct");
+            Query<FullTimeEmployee> q = pm.newNamedQuery(FullTimeEmployee.class, "constructor");
             q.setParameters("R&D");
             List<Info> infos = q.executeResultList(Info.class);
 
@@ -1447,7 +1447,7 @@ public class SampleQueries extends Query
                     "select avg(salary), sum(salary), department.name " +
                             "from org.apache.jdo.tck.pc.company.FullTimeEmployee " +
                             "group by department.name having count(department.name) >
1";
-            Query<FullTimeEmployee> q = pm.newNamedQuery(FullTimeEmployee.class, "group");
+            Query<FullTimeEmployee> q = pm.newNamedQuery(FullTimeEmployee.class, "grouping");
             List<Object[]> results = q.executeResultList(Object[].class);
             if (results.size() != 1) {
                 fail(ASSERTION_FAILED,
@@ -2114,7 +2114,7 @@ public class SampleQueries extends Query
                     "select e.firstname from org.apache.jdo.tck.pc.company.Department " +
                             "where name.startsWith('R&D') && employees.contains(e)
" +
                             "variables org.apache.jdo.tck.pc.company.Employee e";
-            Query<Department> q = pm.newNamedQuery(Department.class, "variables");
+            Query<Department> q = pm.newNamedQuery(Department.class, "projectingVariables");
             List<String> names = q.executeResultList(String.class);
             List<String> expected = Arrays.asList("Michael", "Craig", "Joe");
             checkQueryResultWithoutOrder(ASSERTION_FAILED, singleStringQuery, names, expected);

Modified: db/jdo/trunk/tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/company/package.jdo
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/company/package.jdo?rev=1804869&r1=1804868&r2=1804869&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/company/package.jdo
(original)
+++ db/jdo/trunk/tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/company/package.jdo
Sat Aug 12 18:11:58 2017
@@ -62,10 +62,12 @@ has application identity.
                 <collection element-type="org.apache.jdo.tck.pc.company.MeetingRoom"/>
                 <join/>
             </field>
-            <query name="variables">
-                select e.firstname
-                where name.startsWith('R&amp;D') &amp;&amp; employees.contains(e)
-                variables org.apache.jdo.tck.pc.company.Employee e
+            <query name="projectingVariables">
+	        <![CDATA[
+		    select e.firstname
+                    where name.startsWith('R&D') && employees.contains(e)
+                    variables org.apache.jdo.tck.pc.company.Employee e
+	        ]]>  
             </query>
         </class>
 
@@ -89,13 +91,17 @@ has application identity.
         <class name="FullTimeEmployee"
             identity-type="application"
             persistence-capable-superclass="org.apache.jdo.tck.pc.company.Employee">
-            <query name="construct">
-                select new org.apache.jdo.tck.query.api.SampleQueries$Info (firstname, salary,
manager)
-                where department.name == :deptName
+            <query name="constructor">
+	        <![CDATA[
+                    select new org.apache.jdo.tck.query.api.SampleQueries$Info (firstname,
salary, manager)
+                    where department.name == :deptName
+	        ]]>
             </query>
-            <query name="group">
-                select avg(salary), sum(salary), department.name
-                group by department.name having count(department.name) > 1
+            <query name="grouping">
+	        <![CDATA[
+                    select avg(salary), sum(salary), department.name
+                    group by department.name having count(department.name) > 1
+                ]]>
             </query>
         </class>
 

Modified: db/jdo/trunk/tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/package.jdo
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/package.jdo?rev=1804869&r1=1804868&r2=1804869&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/package.jdo (original)
+++ db/jdo/trunk/tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/package.jdo Sat
Aug 12 18:11:58 2017
@@ -52,10 +52,12 @@ has datastore identity.
                 <collection element-type="org.apache.jdo.tck.pc.company.MeetingRoom"/>
                 <join/>
             </field>
-            <query name="variables">
-                select e.firstname
-                where name.startsWith('R&amp;D') &amp;&amp; employees.contains(e)
-                variables org.apache.jdo.tck.pc.company.Employee e
+           <query name="projectingVariables">
+	        <![CDATA[
+		    select e.firstname
+                    where name.startsWith('R&D') && employees.contains(e)
+                    variables org.apache.jdo.tck.pc.company.Employee e
+	        ]]>  
             </query>
         </class>
 
@@ -75,13 +77,17 @@ has datastore identity.
         </class>
 
         <class name="FullTimeEmployee" identity-type="datastore">
-            <query name="construct">
-                select new org.apache.jdo.tck.query.api.SampleQueries$Info (firstname, salary,
manager)
-                where department.name == :deptName
+            <query name="constructor">
+	        <![CDATA[
+                    select new org.apache.jdo.tck.query.api.SampleQueries$Info (firstname,
salary, manager)
+                    where department.name == :deptName
+	        ]]>
             </query>
-            <query name="group">
-                select avg(salary), sum(salary), department.name
-                group by department.name having count(department.name) > 1
+            <query name="grouping">
+	        <![CDATA[
+                    select avg(salary), sum(salary), department.name
+                    group by department.name having count(department.name) > 1
+                ]]>
             </query>
         </class>
 



Mime
View raw message