cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r633985 - in /cayenne/main/branches/cayenne-jdk1.5-generics-unpublished: ./ src/main/java/org/apache/cayenne/ src/main/java/org/apache/cayenne/access/ src/main/java/org/apache/cayenne/query/ src/test/java/org/apache/cayenne/ src/test/java/o...
Date Wed, 05 Mar 2008 19:17:58 GMT
Author: aadamchik
Date: Wed Mar  5 11:17:57 2008
New Revision: 633985

URL: http://svn.apache.org/viewvc?rev=633985&view=rev
Log:
generics select
(extending ObjectContext)

Added:
    cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/query/Select.java
Modified:
    cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/.project
    cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/pom.xml
    cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/BaseContext.java
    cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/ObjectContext.java
    cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
    cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/test/java/org/apache/cayenne/MockObjectContext.java
    cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/test/java/org/apache/cayenne/enhancer/MockObjectContext.java

Modified: cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/.project
URL: http://svn.apache.org/viewvc/cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/.project?rev=633985&r1=633984&r2=633985&view=diff
==============================================================================
--- cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/.project (original)
+++ cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/.project Wed Mar  5 11:17:57
2008
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>cayenne-jdk1.5-unpublished</name>
+	<name>cayenne-jdk1.5-generics-unpublished</name>
 	<comment>Cayenne Java 1.5 Core</comment>
 	<projects>
 	</projects>

Modified: cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/pom.xml
URL: http://svn.apache.org/viewvc/cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/pom.xml?rev=633985&r1=633984&r2=633985&view=diff
==============================================================================
--- cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/pom.xml (original)
+++ cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/pom.xml Wed Mar  5 11:17:57
2008
@@ -31,7 +31,7 @@
 	</parent>
 
 	<groupId>org.apache.cayenne.unpublished</groupId>
-	<artifactId>cayenne-jdk1.5-unpublished</artifactId>
+	<artifactId>cayenne-jdk1.5-generics-unpublished</artifactId>
 	<name>Cayenne Java 1.5 Unpublished</name>
 	<description>Cayenne Java 1.5 Unpublished</description>
 	<packaging>jar</packaging>

Modified: cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/BaseContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/BaseContext.java?rev=633985&r1=633984&r2=633985&view=diff
==============================================================================
--- cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/BaseContext.java
(original)
+++ cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/BaseContext.java
Wed Mar  5 11:17:57 2008
@@ -26,6 +26,7 @@
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.ObjectIdQuery;
 import org.apache.cayenne.query.Query;
+import org.apache.cayenne.query.Select;
 import org.apache.cayenne.reflect.Property;
 import org.apache.cayenne.reflect.ClassDescriptor;
 import org.apache.cayenne.reflect.PropertyVisitor;
@@ -75,6 +76,13 @@
 
     @SuppressWarnings("unchecked")
     public abstract List performQuery(Query query);
+    
+    /**
+     * @since 3.0
+     */
+    public <T> List<T> performSelect(Select<T> query) {
+        return performQuery(query);
+    }
 
     /**
      * @deprecated since 3.0 this method is replaced by

Modified: cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/ObjectContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/ObjectContext.java?rev=633985&r1=633984&r2=633985&view=diff
==============================================================================
--- cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/ObjectContext.java
(original)
+++ cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/ObjectContext.java
Wed Mar  5 11:17:57 2008
@@ -26,6 +26,7 @@
 import org.apache.cayenne.graph.GraphManager;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.Query;
+import org.apache.cayenne.query.Select;
 
 /**
  * A Cayenne object facade to a persistent store. Instances of ObjectContext are used in
@@ -158,6 +159,13 @@
      */
     @SuppressWarnings("unchecked")
     List performQuery(Query query);
+    
+    /**
+     * Performs a select query with parameterized result.
+     * 
+     * @since 3.0 
+     */
+    <T> List<T> performSelect(Select<T> query);
 
     /**
      * Executes any kind of query providing the result in a form of QueryResponse.

Modified: cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java?rev=633985&r1=633984&r2=633985&view=diff
==============================================================================
--- cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
(original)
+++ cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
Wed Mar  5 11:17:57 2008
@@ -65,6 +65,7 @@
 import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.QueryMetadata;
 import org.apache.cayenne.query.RefreshQuery;
+import org.apache.cayenne.query.Select;
 import org.apache.cayenne.reflect.AttributeProperty;
 import org.apache.cayenne.reflect.ClassDescriptor;
 import org.apache.cayenne.reflect.PropertyVisitor;

Added: cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/query/Select.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/query/Select.java?rev=633985&view=auto
==============================================================================
--- cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/query/Select.java
(added)
+++ cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/main/java/org/apache/cayenne/query/Select.java
Wed Mar  5 11:17:57 2008
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.query;
+
+/**
+ * A selecting query with a parameterized return type.
+ * 
+ * @author andrus
+ */
+public interface Select<T> extends Query {
+
+}

Modified: cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/test/java/org/apache/cayenne/MockObjectContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/test/java/org/apache/cayenne/MockObjectContext.java?rev=633985&r1=633984&r2=633985&view=diff
==============================================================================
--- cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/test/java/org/apache/cayenne/MockObjectContext.java
(original)
+++ cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/test/java/org/apache/cayenne/MockObjectContext.java
Wed Mar  5 11:17:57 2008
@@ -25,6 +25,7 @@
 import org.apache.cayenne.graph.GraphManager;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.Query;
+import org.apache.cayenne.query.Select;
 
 /**
  * A noop ObjectContext used for unit testing.
@@ -82,6 +83,13 @@
 
     public List performQuery(Query query) {
         return null;
+    }
+    
+    /**
+     * @since 3.0
+     */
+    public <T> List<T> performSelect(Select<T> query) {
+        return performQuery(query);
     }
 
     public int[] performNonSelectingQuery(Query query) {

Modified: cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/test/java/org/apache/cayenne/enhancer/MockObjectContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/test/java/org/apache/cayenne/enhancer/MockObjectContext.java?rev=633985&r1=633984&r2=633985&view=diff
==============================================================================
--- cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/test/java/org/apache/cayenne/enhancer/MockObjectContext.java
(original)
+++ cayenne/main/branches/cayenne-jdk1.5-generics-unpublished/src/test/java/org/apache/cayenne/enhancer/MockObjectContext.java
Wed Mar  5 11:17:57 2008
@@ -30,6 +30,7 @@
 import org.apache.cayenne.graph.GraphManager;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.Query;
+import org.apache.cayenne.query.Select;
 
 public class MockObjectContext implements ObjectContext {
 
@@ -95,6 +96,13 @@
     }
 
     public List performQuery(Query query) {
+        return null;
+    }
+    
+    /**
+     * @since 3.0
+     */
+    public <T> List<T> performSelect(Select<T> query) {
         return null;
     }
 



Mime
View raw message