cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r572039 - /cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java
Date Sun, 02 Sep 2007 17:23:17 GMT
Author: aadamchik
Date: Sun Sep  2 10:23:17 2007
New Revision: 572039

URL: http://svn.apache.org/viewvc?rev=572039&view=rev
Log:
removing noop code

Modified:
    cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java

Modified: cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java?rev=572039&r1=572038&r2=572039&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jpa-unpublished/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java
Sun Sep  2 10:23:17 2007
@@ -430,27 +430,21 @@
             }
 
             Object relationship = path.getObject();
-            Collection<JpaJoinColumn> joinColumns = null;
-            String mappedBy = null;
 
             if (relationship instanceof JpaOneToOne) {
-                joinColumns = ((JpaOneToOne) relationship).getJoinColumns();
-                mappedBy = ((JpaOneToOne) relationship).getMappedBy();
-                if (joinColumns.isEmpty() && mappedBy != null) {
-                    joinColumns.add(new JpaJoinColumn(AnnotationPrototypes
-                            .getJoinColumn()));
-                }
-            }
-            else if (relationship instanceof JpaOneToMany) {
-                joinColumns = ((JpaOneToMany) relationship).getJoinColumns();
-                mappedBy = ((JpaOneToMany) relationship).getMappedBy();
-                if (joinColumns.isEmpty() && mappedBy != null) {
+
+                JpaOneToOne oneToOne = (JpaOneToOne) relationship;
+                Collection<JpaJoinColumn> joinColumns = oneToOne.getJoinColumns();
+                String mappedBy = oneToOne.getMappedBy();
+                if (joinColumns.isEmpty() && mappedBy == null) {
                     joinColumns.add(new JpaJoinColumn(AnnotationPrototypes
                             .getJoinColumn()));
                 }
             }
             else if (relationship instanceof JpaManyToOne) {
-                joinColumns = ((JpaManyToOne) relationship).getJoinColumns();
+
+                JpaManyToOne manyToOne = (JpaManyToOne) relationship;
+                Collection<JpaJoinColumn> joinColumns = manyToOne.getJoinColumns();
                 if (joinColumns.isEmpty()) {
                     joinColumns.add(new JpaJoinColumn(AnnotationPrototypes
                             .getJoinColumn()));



Mime
View raw message