cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1483479 - in /cayenne/main/trunk: docs/doc/src/main/resources/RELEASE-NOTES.txt framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
Date Thu, 16 May 2013 17:57:15 GMT
Author: aadamchik
Date: Thu May 16 17:57:15 2013
New Revision: 1483479

URL: http://svn.apache.org/r1483479
Log:
CAY-1792  [PATCH] Supply additional factory methods for generic SelectQueries

patch by      Joerg Schoenfisch

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=1483479&r1=1483478&r2=1483479&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Thu May 16 17:57:15 2013
@@ -13,6 +13,7 @@ Date: 
 ----------------------------------
 Changes/New Features:
 
+CAY-1294 Generify query
 CAY-1646 Synchronize tabs in Modeler between ObjEntity and DbEntity editor panes
 CAY-1647 Easily switch to/from ObjEntity and DbEntity in Modeler
 CAY-1717 [PATCH] Implement JDBC compatibility layer methods
@@ -39,8 +40,8 @@ CAY-1772 Real support for DbEntity catal
 CAY-1778 TransactionManager to simplify user-managed transactions 
 CAY-1779 Flatten object entities for many to many relationships on reverse engineering 
 CAY-1781 Add StatelessContextRequestHandler as an alternative to the Session-based one
-CAY-1294 Generify query
 CAY-1785 SelectQuery<T> for DataRows
+CAY-1792 [PATCH] Supply additional factory methods for generic SelectQueries 
 CAY-1803 Optimize Expression conversion to String and EJBQL 
 CAY-1809 Remove 'final' modifier from Cayenne, HessianUtil, PropertyComparator, ConversionUtil,
and LinkedDeque
 CAY-1813 Missing ObjEntity Attribute Validation with Duplicate DbEntity Columns

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java?rev=1483479&r1=1483478&r2=1483479&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
Thu May 16 17:57:15 2013
@@ -52,6 +52,17 @@ public class SelectQuery<T> extends Qual
     SelectQueryMetadata metaData = new SelectQueryMetadata();
     
     /**
+     * Creates a SelectQuery that selects objects of a given persistent class.
+     *
+     * @param rootClass the Class of objects fetched by this query.
+     * 
+     * @since 3.2
+     */
+    public static <T> SelectQuery<T> query(Class<T> rootClass) {
+        return new SelectQuery<T>(rootClass);
+    }
+
+    /**
      * Creates a SelectQuery that selects objects of a given persistent class that match
      * supplied qualifier.
      *
@@ -65,6 +76,20 @@ public class SelectQuery<T> extends Qual
     }
     
     /**
+     * Creates a SelectQuery that selects objects of a given persistent class that match
+     * supplied qualifier.
+     *
+     * @param rootClass the Class of objects fetched by this query.
+     * @param qualifier an Expression indicating which objects should be fetched.
+     * @param orderings defines how to order the results, may be null.
+     * 
+     * @since 3.2
+     */
+    public static <T> SelectQuery<T> query(Class<T> rootClass, Expression
qualifier, List<Ordering> orderings) {
+        return new SelectQuery<T>(rootClass, qualifier, orderings);
+    }
+    
+    /**
      * Creates a SelectQuery that selects DataRows that correspond to a given
      * persistent class that match supplied qualifier.
      * 



Mime
View raw message