You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2007/12/26 12:40:21 UTC

svn commit: r606890 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLPathTranslator.java

Author: aadamchik
Date: Wed Dec 26 03:40:20 2007
New Revision: 606890

URL: http://svn.apache.org/viewvc?rev=606890&view=rev
Log:
generics

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLPathTranslator.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLPathTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLPathTranslator.java?rev=606890&r1=606889&r2=606890&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLPathTranslator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLPathTranslator.java Wed Dec 26 03:40:20 2007
@@ -20,7 +20,6 @@
 
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -194,7 +193,8 @@
 
     private void processLastPathComponent() {
 
-        ObjAttribute attribute = (ObjAttribute) currentEntity.getAttribute(lastPathComponent);
+        ObjAttribute attribute = (ObjAttribute) currentEntity
+                .getAttribute(lastPathComponent);
 
         if (attribute != null) {
             processTerminatingAttribute(attribute);
@@ -235,9 +235,7 @@
             resolveJoin(false);
 
             // TODO: andrus, 6/21/2007 - flattened support
-            DbRelationship dbRelationship = relationship
-                    .getDbRelationships()
-                    .get(0);
+            DbRelationship dbRelationship = relationship.getDbRelationships().get(0);
             DbEntity table = (DbEntity) dbRelationship.getTargetEntity();
 
             String alias = this.lastAlias != null ? lastAlias : context.getTableAlias(
@@ -263,19 +261,17 @@
             // match FK against the target object
 
             // TODO: andrus, 6/21/2007 - flattened support
-            DbRelationship dbRelationship = relationship
-                    .getDbRelationships()
-                    .get(0);
+            DbRelationship dbRelationship = relationship.getDbRelationships().get(0);
             DbEntity table = (DbEntity) dbRelationship.getSourceEntity();
 
             String alias = this.lastAlias != null ? lastAlias : context.getTableAlias(
                     idPath,
                     table.getFullyQualifiedName());
 
-            List joins = dbRelationship.getJoins();
+            List<DbJoin> joins = dbRelationship.getJoins();
 
             if (joins.size() == 1) {
-                DbJoin join = (DbJoin) joins.get(0);
+                DbJoin join = joins.get(0);
                 context.append(' ');
                 if (isUsingAliases()) {
                     context.append(alias).append('.');
@@ -283,11 +279,10 @@
                 context.append(join.getSourceName());
             }
             else {
-                Map multiColumnMatch = new HashMap(joins.size() + 2);
+                Map<String, String> multiColumnMatch = new HashMap<String, String>(joins
+                        .size() + 2);
 
-                Iterator it = joins.iterator();
-                while (it.hasNext()) {
-                    DbJoin join = (DbJoin) it.next();
+                for (DbJoin join : joins) {
                     String column = isUsingAliases()
                             ? alias + "." + join.getSourceName()
                             : join.getSourceName();