cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1505106 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/util/NamedObjectFactory.java
Date Sat, 20 Jul 2013 08:18:02 GMT
Author: aadamchik
Date: Sat Jul 20 08:18:02 2013
New Revision: 1505106

URL: http://svn.apache.org/r1505106
Log:
CAY-1736  IllegalArgumentException when synchronizing entities in the Modeler

somewhat based on Ilya's patch, but the fix itself is limited to NamedObjectFactory.java

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/util/NamedObjectFactory.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/util/NamedObjectFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/util/NamedObjectFactory.java?rev=1505106&r1=1505105&r2=1505106&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/util/NamedObjectFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/util/NamedObjectFactory.java
Sat Jul 20 08:18:02 2013
@@ -421,7 +421,7 @@ public abstract class NamedObjectFactory
         @Override
         protected boolean isNameInUse(String name, Object namingContext) {
             Entity ent = (Entity) namingContext;
-            return ent.getAttribute(name) != null;
+            return ent.getAttribute(name) != null || ent.getRelationship(name) != null;
         }
     }
 
@@ -479,7 +479,7 @@ public abstract class NamedObjectFactory
         @Override
         protected boolean isNameInUse(String name, Object namingContext) {
             Entity ent = (Entity) namingContext;
-            return ent.getRelationship(name) != null;
+            return ent.getRelationship(name) != null || ent.getAttribute(name) != null;
         }
 
         /**



Mime
View raw message