cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1221153 - /cayenne/main/trunk/framework/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java
Date Tue, 20 Dec 2011 09:03:31 GMT
Author: oltka
Date: Tue Dec 20 09:03:30 2011
New Revision: 1221153

URL: http://svn.apache.org/viewvc?rev=1221153&view=rev
Log:
CAY-1640 fixed Null pointer exception if you delete a DB relationship for which there is still
an object relationship

Modified:
    cayenne/main/trunk/framework/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java

Modified: cayenne/main/trunk/framework/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java?rev=1221153&r1=1221152&r2=1221153&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java
Tue Dec 20 09:03:30 2011
@@ -137,7 +137,7 @@ class ObjRelationshipValidator extends C
         // check for relationships with same source and target entities
         ObjEntity entity = (ObjEntity) relationship.getSourceEntity();
         for (ObjRelationship rel : entity.getRelationships()) {
-            if (relationship.getDbRelationshipPath().equals(rel.getDbRelationshipPath()))
{
+            if (relationship.getDbRelationshipPath() != null && relationship.getDbRelationshipPath().equals(rel.getDbRelationshipPath()))
{
                 if (relationship != rel && 
                         relationship.getTargetEntity() == rel.getTargetEntity() &&
                         relationship.getSourceEntity() == rel.getSourceEntity()) {



Mime
View raw message