cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amania...@apache.org
Subject svn commit: r600153 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src: main/java/org/apache/cayenne/ main/java/org/apache/cayenne/access/ main/java/org/apache/cayenne/dba/frontbase/ main/java/org/apache/cayenne/exp/ main/java/org/apache...
Date Sat, 01 Dec 2007 16:12:07 GMT
Author: amaniatis
Date: Sat Dec  1 08:12:05 2007
New Revision: 600153

URL: http://svn.apache.org/viewvc?rev=600153&view=rev
Log:
Continuation of generics work. Focus here was on the query package, but a number of other packages were touched as the effects are very intertwined.

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/ObjectId.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomain.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNode.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataPort.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/FlattenedArcKey.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/OptimisticLockException.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryEngine.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryResult.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBasePkGenerator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/Expression.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BatchQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/DeleteBatchQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/InsertBatchQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ObjectIdQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/Ordering.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ParameterizedQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryChain.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/RelationshipQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/UpdateBatchQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/QueryMessage.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RangeQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RemoteSession.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/SyncMessage.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataNodeQueriesTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MiscTypesTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/SQLTemplateActionTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/MockBatchQuery.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/ObjectId.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/ObjectId.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/ObjectId.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/ObjectId.java Sat Dec  1 08:12:05 2007
@@ -49,6 +49,7 @@
     private String singleKey;
     private Object singleValue;
 
+    // key which is used for temporary ObjectIds only
     protected byte[] key;
 
     protected Map<String, Object> replacementIdMap;
@@ -57,6 +58,7 @@
     transient int hashCode;
 
     // exists for deserialization with Hessian and similar
+    @SuppressWarnings("unused")
     private ObjectId() {
     }
 
@@ -66,8 +68,7 @@
      * @since 1.2
      */
     public ObjectId(String entityName) {
-        this.entityName = entityName;
-        this.key = IDUtil.pseudoUniqueByteSequence8();
+        this(entityName, IDUtil.pseudoUniqueByteSequence8());
     }
 
     /**
@@ -84,6 +85,10 @@
     /**
      * Creates a portable permanent ObjectId.
      * 
+     * @param entityName The entity name which this object id is for
+     * @param key A key describing this object id, usually the attribute name for the
+     *            primary key
+     * @param value The unique value for this object id
      * @since 1.2
      */
     public ObjectId(String entityName, String key, int value) {
@@ -93,6 +98,10 @@
     /**
      * Creates a portable permanent ObjectId.
      * 
+     * @param entityName The entity name which this object id is for
+     * @param key A key describing this object id, usually the attribute name for the
+     *            primary key
+     * @param value The unique value for this object id
      * @since 1.2
      */
     public ObjectId(String entityName, String key, Object value) {
@@ -103,8 +112,11 @@
     }
 
     /**
-     * Creates a portable permanent ObjectId.
+     * Creates a portable permanent ObjectId as a compound primary key.
      * 
+     * @param entityName The entity name which this object id is for
+     * @param idMap Keys are usually the attribute names for each part of the primary key.
+     *            Values are unique when taken as a whole.
      * @since 1.2
      */
     public ObjectId(String entityName, Map<String, ?> idMap) {
@@ -127,6 +139,10 @@
         }
     }
 
+    /**
+     * Is this is temporary object id (used for objects which are not yet persisted to the
+     * data store).
+     */
     public boolean isTemporary() {
         return key != null;
     }
@@ -138,6 +154,10 @@
         return entityName;
     }
 
+    /**
+     * Get the binary temporary object id. Null if this object id is permanent (persisted
+     * to the data store).
+     */
     public byte[] getKey() {
         return key;
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomain.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomain.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomain.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomain.java Sat Dec  1 08:12:05 2007
@@ -172,7 +172,7 @@
                     // backwards compatibility mode... only possible in a single-node case
                     // see TODO above
                     if (nodes.size() == 1) {
-                        entitySorter = ((DataNode) nodes.values().iterator().next())
+                        entitySorter = nodes.values().iterator().next()
                                 .getEntitySorter();
                     }
                     else {
@@ -256,7 +256,7 @@
         if (queryCacheFactory != null
                 && dataContextFactory != null
                 && !Util.isEmptyString(dataContextFactory.toString())) {
-            queryCacheFactory = (QueryCacheFactory) createInstance(queryCacheFactory
+            queryCacheFactory = createInstance(queryCacheFactory
                     .toString(), QueryCacheFactory.class);
         }
         else {
@@ -707,8 +707,8 @@
     /**
      * Routes queries to appropriate DataNodes for execution.
      */
-    public <T extends Query> void performQueries(
-            final Collection<T> queries,
+    public void performQueries(
+            final Collection<Query> queries,
             final OperationObserver callback) {
 
         runInTransaction(new Transformer() {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNode.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNode.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNode.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataNode.java Sat Dec  1 08:12:05 2007
@@ -181,8 +181,8 @@
      * 
      * @since 1.1
      */
-    public <T extends Query> void performQueries(
-            Collection<T> queries,
+    public void performQueries(
+            Collection<Query> queries,
             OperationObserver callback) {
 
         int listSize = queries.size();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataPort.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataPort.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataPort.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataPort.java Sat Dec  1 08:12:05 2007
@@ -221,7 +221,7 @@
                         // end of the batch detected... commit and start a new insert
                         // query
                         destinationNode.performQueries(
-                                Collections.singletonList(insert),
+                                Collections.singletonList((Query) insert),
                                 insertObserver);
                         insert = new InsertBatchQuery(entity, batchSize);
                         insertObserver.clear();
@@ -236,7 +236,7 @@
                 // commit remaining batch if needed
                 if (insert.size() > 0) {
                     destinationNode.performQueries(
-                            Collections.singletonList(insert),
+                            Collections.singletonList((Query) insert),
                             insertObserver);
                 }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/FlattenedArcKey.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/FlattenedArcKey.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/FlattenedArcKey.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/FlattenedArcKey.java Sat Dec  1 08:12:05 2007
@@ -173,7 +173,7 @@
 
         final List[] result = new List[1];
 
-        node.performQueries(Collections.singleton(query), new DefaultOperationObserver() {
+        node.performQueries(Collections.singleton((Query) query), new DefaultOperationObserver() {
 
             public void nextDataRows(Query query, List dataRows) {
                 result[0] = dataRows;
@@ -243,19 +243,15 @@
         DbRelationship firstDbRel = (DbRelationship) relList.get(0);
         DbRelationship secondDbRel = (DbRelationship) relList.get(1);
 
-        Map sourceId = this.sourceId.getIdSnapshot();
-        Map destinationId = this.destinationId.getIdSnapshot();
+        Map<String, ?> sourceId = this.sourceId.getIdSnapshot();
+        Map<String, ?> destinationId = this.destinationId.getIdSnapshot();
 
-        Map snapshot = new HashMap(sourceId.size() + destinationId.size(), 1);
-        List joins = firstDbRel.getJoins();
-        for (int i = 0, numJoins = joins.size(); i < numJoins; i++) {
-            DbJoin join = (DbJoin) joins.get(i);
+        Map<String, Object> snapshot = new HashMap<String, Object>(sourceId.size() + destinationId.size(), 1);
+        for (DbJoin join : firstDbRel.getJoins()) {
             snapshot.put(join.getTargetName(), sourceId.get(join.getSourceName()));
         }
 
-        joins = secondDbRel.getJoins();
-        for (int i = 0, numJoins = joins.size(); i < numJoins; i++) {
-            DbJoin join = (DbJoin) joins.get(i);
+        for (DbJoin join : secondDbRel.getJoins()) {
             snapshot.put(join.getSourceName(), destinationId.get(join.getTargetName()));
         }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/OptimisticLockException.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/OptimisticLockException.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/OptimisticLockException.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/OptimisticLockException.java Sat Dec  1 08:12:05 2007
@@ -31,6 +31,7 @@
 import org.apache.cayenne.exp.ExpressionFactory;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
+import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SelectQuery;
 
 /**
@@ -111,7 +112,7 @@
         SelectQuery query = new SelectQuery(rootEntity, qualifier);
         query.setFetchingDataRows(true);
         QueryResult observer = new QueryResult();
-        engine.performQueries(Collections.singletonList(query), observer);
+        engine.performQueries(Collections.singletonList((Query) query), observer);
         List results = observer.getFirstRows(query);
 
         if (results == null || results.isEmpty()) {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryEngine.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryEngine.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryEngine.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryEngine.java Sat Dec  1 08:12:05 2007
@@ -37,8 +37,8 @@
      * 
      * @since 1.1 The signature has changed from List to Collection.
      */
-    <T extends Query> void performQueries(
-            Collection<T> queries,
+    void performQueries(
+            Collection<Query> queries,
             OperationObserver resultConsumer);
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryResult.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryResult.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryResult.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/QueryResult.java Sat Dec  1 08:12:05 2007
@@ -137,9 +137,7 @@
             return Collections.EMPTY_LIST;
         }
         else {
-            Iterator it = allResults.iterator();
-            while (it.hasNext()) {
-                Object obj = it.next();
+            for (Object obj : allResults) {
                 if (obj instanceof List) {
                     return (List) obj;
                 }
@@ -162,9 +160,7 @@
         }
 
         List list = new ArrayList(size);
-        Iterator it = allResults.iterator();
-        while (it.hasNext()) {
-            Object obj = it.next();
+        for (Object obj : allResults) {
             if (obj instanceof List) {
                 list.add(obj);
             }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBasePkGenerator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBasePkGenerator.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBasePkGenerator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBasePkGenerator.java Sat Dec  1 08:12:05 2007
@@ -30,6 +30,7 @@
 import org.apache.cayenne.access.QueryResult;
 import org.apache.cayenne.dba.JdbcPkGenerator;
 import org.apache.cayenne.map.DbEntity;
+import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SQLTemplate;
 
 /**
@@ -106,7 +107,7 @@
 
         SQLTemplate query = new SQLTemplate(entity, template);
         QueryResult observer = new QueryResult();
-        node.performQueries(Collections.singleton(query), observer);
+        node.performQueries(Collections.singleton((Query) query), observer);
 
         List results = observer.getFirstRows(query);
         if (results.size() != 1) {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/Expression.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/Expression.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/Expression.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/Expression.java Sat Dec  1 08:12:05 2007
@@ -26,12 +26,10 @@
 import java.io.StringWriter;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.collections.Transformer;
 import org.apache.cayenne.exp.parser.ASTScalar;
 import org.apache.cayenne.exp.parser.ExpressionParser;
 import org.apache.cayenne.exp.parser.ParseException;
@@ -39,6 +37,7 @@
 import org.apache.cayenne.util.Util;
 import org.apache.cayenne.util.XMLEncoder;
 import org.apache.cayenne.util.XMLSerializable;
+import org.apache.commons.collections.Transformer;
 
 /**
  * Superclass of Cayenne expressions that defines basic API for expressions use.
@@ -359,12 +358,12 @@
     /**
      * Returns a list of objects that match the expression.
      */
-    public List filterObjects(List objects) {
+    public List<Object> filterObjects(List<Object> objects) {
         if (objects == null || objects.size() == 0) {
             return Collections.EMPTY_LIST;
         }
 
-        return (List) filter(objects, new LinkedList());
+        return (List<Object>) filter(objects, new LinkedList<Object>());
     }
 
     /**
@@ -373,10 +372,8 @@
      * 
      * @since 1.1
      */
-    public Collection filter(Collection source, Collection target) {
-        Iterator it = source.iterator();
-        while (it.hasNext()) {
-            Object o = it.next();
+    public Collection<Object> filter(Collection<Object> source, Collection<Object> target) {
+        for (Object o : source) {
             if (match(o)) {
                 target.add(o);
             }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java Sat Dec  1 08:12:05 2007
@@ -22,7 +22,6 @@
 import java.io.Serializable;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.StringTokenizer;
 
@@ -98,7 +97,7 @@
 
             if (root != null) {
                 if (root instanceof Class) {
-                    entity = resolver.lookupObjEntity((Class) root);
+                    entity = resolver.lookupObjEntity((Class<?>) root);
 
                     if (entity != null) {
                         this.dbEntity = entity.getDbEntity();
@@ -145,7 +144,7 @@
         return false;
     }
 
-    void initWithProperties(Map properties) {
+    void initWithProperties(Map<String, ?> properties) {
         // must init defaults even if properties are empty
         if (properties == null) {
             properties = Collections.EMPTY_MAP;
@@ -414,13 +413,9 @@
      * 
      * @since 1.2
      */
-    void addPrefetches(Collection prefetches, int semantics) {
-
-        if (prefetches != null && !prefetches.isEmpty()) {
-
-            Iterator it = prefetches.iterator();
-            while (it.hasNext()) {
-                String prefetch = (String) it.next();
+    void addPrefetches(Collection<String> prefetches, int semantics) {
+        if (prefetches != null) {
+            for (String prefetch : prefetches) {
                 addPrefetch(prefetch, semantics);
             }
         }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BatchQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BatchQuery.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BatchQuery.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BatchQuery.java Sat Dec  1 08:12:05 2007
@@ -123,7 +123,7 @@
     /**
      * Returns a list of DbAttributes describing batch parameters.
      */
-    public abstract List getDbAttributes();
+    public abstract List<DbAttribute> getDbAttributes();
 
     /**
      * Rewinds batch to the first parameter row.
@@ -160,7 +160,7 @@
      * 
      * @since 1.2
      */
-    protected Object getValue(Map valueMap, DbAttribute attribute) {
+    protected Object getValue(Map<String, Object> valueMap, DbAttribute attribute) {
 
         Object value = valueMap.get(attribute.getName());
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/DeleteBatchQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/DeleteBatchQuery.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/DeleteBatchQuery.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/DeleteBatchQuery.java Sat Dec  1 08:12:05 2007
@@ -35,12 +35,12 @@
  */
 public class DeleteBatchQuery extends BatchQuery {
 
-    protected List qualifierSnapshots;
-    protected List dbAttributes;
+    protected List<Map> qualifierSnapshots;
+    protected List<DbAttribute> dbAttributes;
     protected boolean usingOptimisticLocking;
 
     private Collection<DbAttribute> qualifierAttributes;
-    private Collection nullQualifierNames;
+    private Collection<String> nullQualifierNames;
 
     /**
      * Creates new DeleteBatchQuery. Used by
@@ -64,7 +64,7 @@
      * @param batchCapacity Estimated size of the batch.
      */
     public DeleteBatchQuery(DbEntity dbEntity,
-            Collection<DbAttribute> qualifierAttributes, Collection nullQualifierNames,
+            Collection<DbAttribute> qualifierAttributes, Collection<String> nullQualifierNames,
             int batchCapacity) {
 
         super(dbEntity);
@@ -74,8 +74,8 @@
                 ? nullQualifierNames
                 : Collections.EMPTY_SET;
 
-        qualifierSnapshots = new ArrayList(batchCapacity);
-        dbAttributes = new ArrayList(qualifierAttributes.size());
+        qualifierSnapshots = new ArrayList<Map>(batchCapacity);
+        dbAttributes = new ArrayList<DbAttribute>(qualifierAttributes.size());
         dbAttributes.addAll(qualifierAttributes);
         batchIndex = -1;
     }
@@ -113,7 +113,7 @@
     }
 
     public Object getValue(int dbAttributeIndex) {
-        DbAttribute attribute = (DbAttribute) dbAttributes.get(dbAttributeIndex);
+        DbAttribute attribute = dbAttributes.get(dbAttributeIndex);
         return getCurrentQualifier().get(attribute.getName());
     }
 
@@ -125,7 +125,7 @@
         return qualifierSnapshots.size();
     }
 
-    public List getDbAttributes() {
+    public List<DbAttribute> getDbAttributes() {
         return dbAttributes;
     }
 
@@ -135,6 +135,6 @@
      * @since 1.2
      */
     public Map getCurrentQualifier() {
-        return (Map) qualifierSnapshots.get(batchIndex);
+        return qualifierSnapshots.get(batchIndex);
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/InsertBatchQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/InsertBatchQuery.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/InsertBatchQuery.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/InsertBatchQuery.java Sat Dec  1 08:12:05 2007
@@ -39,10 +39,10 @@
     /**
      * @since 1.2
      */
-    protected List objectIds;
+    protected List<ObjectId> objectIds;
 
-    protected List objectSnapshots;
-    protected List dbAttributes;
+    protected List<Map> objectSnapshots;
+    protected List<DbAttribute> dbAttributes;
 
     /**
      * Creates new InsertBatchQuery for a given DbEntity and estimated capacity.
@@ -50,14 +50,14 @@
     public InsertBatchQuery(DbEntity entity, int batchCapacity) {
         super(entity);
 
-        this.objectSnapshots = new ArrayList(batchCapacity);
-        this.objectIds = new ArrayList(batchCapacity);
+        this.objectSnapshots = new ArrayList<Map>(batchCapacity);
+        this.objectIds = new ArrayList<ObjectId>(batchCapacity);
         this.dbAttributes = new ArrayList(getDbEntity().getAttributes());
     }
 
     public Object getValue(int dbAttributeIndex) {
-        DbAttribute attribute = (DbAttribute) dbAttributes.get(dbAttributeIndex);
-        Map currentSnapshot = (Map) objectSnapshots.get(batchIndex);
+        DbAttribute attribute = dbAttributes.get(dbAttributeIndex);
+        Map currentSnapshot = objectSnapshots.get(batchIndex);
         return getValue(currentSnapshot, attribute);
     }
 
@@ -85,7 +85,7 @@
         return objectSnapshots.size();
     }
 
-    public List getDbAttributes() {
+    public List<DbAttribute> getDbAttributes() {
         return dbAttributes;
     }
 
@@ -97,6 +97,6 @@
      * @since 1.2
      */
     public ObjectId getObjectId() {
-        return (ObjectId) objectIds.get(batchIndex);
+        return objectIds.get(batchIndex);
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ObjectIdQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ObjectIdQuery.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ObjectIdQuery.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ObjectIdQuery.java Sat Dec  1 08:12:05 2007
@@ -54,6 +54,7 @@
     protected transient QueryMetadata metadata;
 
     // needed for hessian serialization
+    @SuppressWarnings("unused")
     private ObjectIdQuery() {
         this.cachePolicy = CACHE_REFRESH;
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/Ordering.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/Ordering.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/Ordering.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/Ordering.java Sat Dec  1 08:12:05 2007
@@ -43,7 +43,7 @@
  * @author Andrus Adamchik
  * @author Craig Miskell
  */
-public class Ordering implements Comparator, Serializable, XMLSerializable {
+public class Ordering implements Comparator<Object>, Serializable, XMLSerializable {
 
     /**
      * Symbolic representation of ascending ordering criterion.
@@ -68,7 +68,7 @@
      * is more significant than any other Ordering with higher index. List being ordered is
      * modified in place.
      */
-    public static void orderList(List objects, List orderings) {
+    public static void orderList(List<Object> objects, List<Comparator<Object>> orderings) {
         Collections.sort(objects, ComparatorUtils.chainedComparator(orderings));
     }
 
@@ -206,7 +206,7 @@
      * 
      * @param objects a List of objects to be sorted
      */
-    public void orderList(List objects) {
+    public void orderList(List<Object> objects) {
         Collections.sort(objects, this);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ParameterizedQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ParameterizedQuery.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ParameterizedQuery.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ParameterizedQuery.java Sat Dec  1 08:12:05 2007
@@ -36,5 +36,5 @@
      * parameters. In case of select queries, it is up to the implementing query to name
      * the new query to avoid cache key conflicts.
      */
-    public Query createQuery(Map<?,?> parameters);
+    public Query createQuery(Map<String,?> parameters);
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryChain.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryChain.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryChain.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryChain.java Sat Dec  1 08:12:05 2007
@@ -22,7 +22,6 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Iterator;
 
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.map.EntityResolver;
@@ -37,7 +36,7 @@
  */
 public class QueryChain implements Query {
 
-    protected Collection chain;
+    protected Collection<Query> chain;
     protected String name;
 
     /**
@@ -51,16 +50,16 @@
      */
     public QueryChain(Query[] queries) {
         if (queries != null && queries.length > 0) {
-            this.chain = new ArrayList(Arrays.asList(queries));
+            this.chain = new ArrayList<Query>(Arrays.asList(queries));
         }
     }
 
     /**
      * Creates a new QueryChain with a collection of Queries.
      */
-    public QueryChain(Collection queries) {
+    public QueryChain(Collection<Query> queries) {
         if (queries != null && !queries.isEmpty()) {
-            this.chain = new ArrayList(queries);
+            this.chain = new ArrayList<Query>(queries);
         }
     }
 
@@ -69,7 +68,7 @@
      */
     public void addQuery(Query query) {
         if (chain == null) {
-            chain = new ArrayList();
+            chain = new ArrayList<Query>();
         }
 
         chain.add(query);
@@ -93,9 +92,7 @@
      */
     public void route(QueryRouter router, EntityResolver resolver, Query substitutedQuery) {
         if (chain != null && !chain.isEmpty()) {
-            Iterator it = chain.iterator();
-            while (it.hasNext()) {
-                Query q = (Query) it.next();
+            for (Query q : chain) {
                 q.route(router, resolver, substitutedQuery);
             }
         }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/RelationshipQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/RelationshipQuery.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/RelationshipQuery.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/RelationshipQuery.java Sat Dec  1 08:12:05 2007
@@ -49,6 +49,7 @@
     protected transient ArcProperty arc;
 
     // exists for deserialization with Hessian
+    @SuppressWarnings("unused")
     private RelationshipQuery() {
 
     }

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=600153&r1=600152&r2=600153&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 Sat Dec  1 08:12:05 2007
@@ -190,7 +190,7 @@
      * 
      * @since 1.1
      */
-    public void initWithProperties(Map<?,?> properties) {
+    public void initWithProperties(Map<String,?> properties) {
 
         // must init defaults even if properties are empty
         if (properties == null) {
@@ -282,7 +282,7 @@
      * A shortcut for {@link #queryWithParameters(Map, boolean)}that prunes parts of
      * qualifier that have no parameter value set.
      */
-    public SelectQuery queryWithParameters(Map<?,?> parameters) {
+    public SelectQuery queryWithParameters(Map<String,?> parameters) {
         return queryWithParameters(parameters, true);
     }
 
@@ -338,7 +338,7 @@
      * 
      * @since 1.1
      */
-    public Query createQuery(Map<?,?> parameters) {
+    public Query createQuery(Map<String,?> parameters) {
         return queryWithParameters(parameters);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java Sat Dec  1 08:12:05 2007
@@ -18,8 +18,6 @@
  ****************************************************************/
 package org.apache.cayenne.query;
 
-import java.util.Iterator;
-
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.map.ObjEntity;
 
@@ -59,10 +57,7 @@
                 }
 
                 if (!query.getOrderings().isEmpty()) {
-                    Iterator it = query.getOrderings().iterator();
-                    while (it.hasNext()) {
-
-                        Ordering o = (Ordering) it.next();
+                   for (Ordering o : query.getOrderings()) {
                         key.append('/').append(o.getSortSpecString());
                         if (!o.isAscending()) {
                             key.append(":d");

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/UpdateBatchQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/UpdateBatchQuery.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/UpdateBatchQuery.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/UpdateBatchQuery.java Sat Dec  1 08:12:05 2007
@@ -39,17 +39,17 @@
     /**
      * @since 1.2
      */
-    protected List objectIds;
+    protected List<ObjectId> objectIds;
 
     protected List qualifierSnapshots;
     protected List updateSnapshots;
 
     protected boolean usingOptimisticLocking;
 
-    private List updatedAttributes;
-    private List qualifierAttributes;
-    private Collection nullQualifierNames;
-    private List dbAttributes;
+    private List<DbAttribute> updatedAttributes;
+    private List<DbAttribute> qualifierAttributes;
+    private Collection<String> nullQualifierNames;
+    private List<DbAttribute> dbAttributes;
 
     /**
      * Creates new UpdateBatchQuery.
@@ -61,8 +61,8 @@
      * @param updatedAttribute DbAttributes describing updated columns.
      * @param batchCapacity Estimated size of the batch.
      */
-    public UpdateBatchQuery(DbEntity dbEntity, List qualifierAttributes,
-            List updatedAttribute, Collection nullQualifierNames, int batchCapacity) {
+    public UpdateBatchQuery(DbEntity dbEntity, List<DbAttribute> qualifierAttributes,
+            List<DbAttribute> updatedAttribute, Collection<String> nullQualifierNames, int batchCapacity) {
 
         super(dbEntity);
 
@@ -74,9 +74,9 @@
 
         qualifierSnapshots = new ArrayList(batchCapacity);
         updateSnapshots = new ArrayList(batchCapacity);
-        objectIds = new ArrayList(batchCapacity);
+        objectIds = new ArrayList<ObjectId>(batchCapacity);
 
-        dbAttributes = new ArrayList(updatedAttributes.size()
+        dbAttributes = new ArrayList<DbAttribute>(updatedAttributes.size()
                 + qualifierAttributes.size());
         dbAttributes.addAll(updatedAttributes);
         dbAttributes.addAll(qualifierAttributes);
@@ -108,7 +108,7 @@
     }
 
     public Object getValue(int dbAttributeIndex) {
-        DbAttribute attribute = (DbAttribute) dbAttributes.get(dbAttributeIndex);
+        DbAttribute attribute = dbAttributes.get(dbAttributeIndex);
 
         // take value either from updated values or id's,
         // depending on the index
@@ -139,21 +139,21 @@
         return qualifierSnapshots.size();
     }
 
-    public List getDbAttributes() {
+    public List<DbAttribute> getDbAttributes() {
         return dbAttributes;
     }
 
     /**
      * @since 1.1
      */
-    public List getUpdatedAttributes() {
+    public List <DbAttribute> getUpdatedAttributes() {
         return Collections.unmodifiableList(updatedAttributes);
     }
 
     /**
      * @since 1.1
      */
-    public List getQualifierAttributes() {
+    public List<DbAttribute> getQualifierAttributes() {
         return Collections.unmodifiableList(qualifierAttributes);
     }
 
@@ -174,6 +174,6 @@
      * @since 1.2
      */
     public ObjectId getObjectId() {
-        return (ObjectId) objectIds.get(batchIndex);
+        return objectIds.get(batchIndex);
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/QueryMessage.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/QueryMessage.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/QueryMessage.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/QueryMessage.java Sat Dec  1 08:12:05 2007
@@ -33,6 +33,7 @@
     protected Query query;
 
     // for hessian serialization
+    @SuppressWarnings("unused")
     private QueryMessage() {
 
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RangeQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RangeQuery.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RangeQuery.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RangeQuery.java Sat Dec  1 08:12:05 2007
@@ -49,6 +49,7 @@
     private PrefetchTreeNode prefetchTree;
 
     // exists for hessian serialization.
+    @SuppressWarnings("unused")
     private RangeQuery() {
 
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RemoteSession.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RemoteSession.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RemoteSession.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RemoteSession.java Sat Dec  1 08:12:05 2007
@@ -54,6 +54,7 @@
     protected Map eventBridgeParameters;
 
     // private constructor used by hessian deserialization mechanism
+    @SuppressWarnings("unused")
     private RemoteSession() {
 
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/SyncMessage.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/SyncMessage.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/SyncMessage.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/SyncMessage.java Sat Dec  1 08:12:05 2007
@@ -39,6 +39,7 @@
     protected GraphDiff senderChanges;
 
     // private constructor for Hessian deserialization
+    @SuppressWarnings("unused")
     private SyncMessage() {
 
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataNodeQueriesTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataNodeQueriesTest.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataNodeQueriesTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataNodeQueriesTest.java Sat Dec  1 08:12:05 2007
@@ -29,6 +29,7 @@
 
 import org.apache.art.Artist;
 import org.apache.cayenne.map.DbEntity;
+import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SQLAction;
 import org.apache.cayenne.query.SQLTemplate;
 import org.apache.cayenne.query.SelectQuery;
@@ -74,7 +75,7 @@
         query.setParameters(bindings);
 
         MockOperationObserver observer = new MockOperationObserver();
-        getNode().performQueries(Collections.singletonList(query), observer);
+        getNode().performQueries(Collections.singletonList((Query) query), observer);
         assertNotNull(observer.countsForQuery(query));
         assertEquals(1, observer.countsForQuery(query)[0]);
 
@@ -98,7 +99,7 @@
         SQLTemplate query = new SQLTemplate(Object.class, template);
 
         MockOperationObserver observer = new MockOperationObserver();
-        getNode().performQueries(Collections.singletonList(query), observer);
+        getNode().performQueries(Collections.singletonList((Query) query), observer);
 
         List data = observer.rowsForQuery(query);
         assertEquals(DataContextCase.artistCount, data.size());
@@ -115,7 +116,7 @@
         getSQLTemplateBuilder().updateSQLTemplate(query);
 
         MockOperationObserver observer = new MockOperationObserver();
-        getNode().performQueries(Collections.singletonList(query), observer);
+        getNode().performQueries(Collections.singletonList((Query) query), observer);
 
         List data = observer.rowsForQuery(query);
         assertEquals(DataContextCase.artistCount, data.size());
@@ -134,7 +135,7 @@
         SQLTemplate query = new SQLTemplate(Object.class, template);
 
         MockOperationObserver observer = new MockOperationObserver();
-        getNode().performQueries(Collections.singletonList(query), observer);
+        getNode().performQueries(Collections.singletonList((Query) query), observer);
 
         List data = observer.rowsForQuery(query);
         assertEquals(DataContextCase.artistCount, data.size());

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MiscTypesTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MiscTypesTest.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MiscTypesTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/MiscTypesTest.java Sat Dec  1 08:12:05 2007
@@ -43,7 +43,7 @@
 
         DataContext context = createDataContext();
 
-        SerializableEntity test = (SerializableEntity) context
+        SerializableEntity test = context
                 .newObject(SerializableEntity.class);
 
         MockSerializable i = new MockSerializable("abc");
@@ -62,7 +62,7 @@
     public void testByteArray() {
         DataContext context = createDataContext();
 
-        ArraysEntity test = (ArraysEntity) context.newObject(ArraysEntity.class);
+        ArraysEntity test = context.newObject(ArraysEntity.class);
 
         byte[] a = new byte[] {
                 1, 2, 3
@@ -82,7 +82,7 @@
     public void testCharArray() {
         DataContext context = createDataContext();
 
-        ArraysEntity test = (ArraysEntity) context.newObject(ArraysEntity.class);
+        ArraysEntity test = context.newObject(ArraysEntity.class);
 
         char[] a = new char[] {
                 'x', 'y', 'z'
@@ -102,7 +102,7 @@
     public void testCharacterArray() {
         DataContext context = createDataContext();
 
-        ArraysEntity test = (ArraysEntity) context.newObject(ArraysEntity.class);
+        ArraysEntity test = context.newObject(ArraysEntity.class);
 
         Character[] a = new Character[] {
                 new Character('x'), new Character('y'), new Character('z')
@@ -122,7 +122,7 @@
     public void testCharacter() {
         DataContext context = createDataContext();
 
-        CharacterEntity test = (CharacterEntity) context.newObject(CharacterEntity.class);
+        CharacterEntity test = context.newObject(CharacterEntity.class);
 
         test.setCharacterField(new Character('c'));
         context.commitChanges();
@@ -139,7 +139,7 @@
     public void testByteWrapperArray() {
         DataContext context = createDataContext();
 
-        ArraysEntity test = (ArraysEntity) context.newObject(ArraysEntity.class);
+        ArraysEntity test = context.newObject(ArraysEntity.class);
 
         Byte[] a = new Byte[] {
                 new Byte((byte) 1), new Byte((byte) 2), new Byte((byte) 3)

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/SQLTemplateActionTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/SQLTemplateActionTest.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/SQLTemplateActionTest.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/SQLTemplateActionTest.java Sat Dec  1 08:12:05 2007
@@ -32,6 +32,7 @@
 import org.apache.cayenne.access.QueryResult;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SQLAction;
 import org.apache.cayenne.query.SQLTemplate;
 import org.apache.cayenne.query.SelectQuery;
@@ -344,6 +345,6 @@
         map.put("id", new Integer(artistId));
 
         template.setParameters(map);
-        getNode().performQueries(Collections.singleton(template), new QueryResult());
+        getNode().performQueries(Collections.singleton((Query) template), new QueryResult());
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/MockBatchQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/MockBatchQuery.java?rev=600153&r1=600152&r2=600153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/MockBatchQuery.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/MockBatchQuery.java Sat Dec  1 08:12:05 2007
@@ -21,8 +21,8 @@
 
 import java.util.List;
 
+import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
-import org.apache.cayenne.query.BatchQuery;
 
 /**
  * @author Andrus Adamchik
@@ -37,7 +37,7 @@
         super(dbEntity);
     }
 
-    public List getDbAttributes() {
+    public List<DbAttribute> getDbAttributes() {
         return null;
     }
 



Mime
View raw message