cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johnth...@apache.org
Subject [4/5] cayenne git commit: Modeler - fix warning about non-PK joins so that missing reverse relationships don't trigger it, and fix typo in the message
Date Wed, 12 Dec 2018 20:49:24 GMT
Modeler - fix warning about non-PK joins so that missing reverse relationships don't trigger
it, and fix typo in the message


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/55c91f99
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/55c91f99
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/55c91f99

Branch: refs/heads/master
Commit: 55c91f99306da5e1d97d8f25fbd62d67d001b62b
Parents: 220e1cb
Author: John Huss <johnthuss@apache.org>
Authored: Tue Dec 11 09:10:46 2018 -0600
Committer: John Huss <johnthuss@apache.org>
Committed: Wed Dec 12 14:48:55 2018 -0600

----------------------------------------------------------------------
 .../cayenne/project/validation/DbRelationshipValidator.java      | 4 ++--
 .../cayenne/project/validation/ObjRelationshipValidator.java     | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/55c91f99/cayenne-project/src/main/java/org/apache/cayenne/project/validation/DbRelationshipValidator.java
----------------------------------------------------------------------
diff --git a/cayenne-project/src/main/java/org/apache/cayenne/project/validation/DbRelationshipValidator.java
b/cayenne-project/src/main/java/org/apache/cayenne/project/validation/DbRelationshipValidator.java
index 8ddc5f9..c5f9168 100644
--- a/cayenne-project/src/main/java/org/apache/cayenne/project/validation/DbRelationshipValidator.java
+++ b/cayenne-project/src/main/java/org/apache/cayenne/project/validation/DbRelationshipValidator.java
@@ -73,11 +73,11 @@ class DbRelationshipValidator extends ConfigurationNodeValidator {
 
         if(!relationship.isToPK()) {
             DbRelationship reverseRelationship = relationship.getReverseRelationship();
-            if(reverseRelationship == null || !reverseRelationship.isToPK()) {
+            if(reverseRelationship != null && !reverseRelationship.isToPK()) {
                 addFailure(
                         validationResult,
                         relationship,
-                        "DbRelationship '%s' has join not to PK. Cayenne doesn't allow this
type of relashionships",
+                        "DbRelationship '%s' has join not to PK. Cayenne doesn't allow this
type of relationship",
                         toString(relationship));
             }
         }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/55c91f99/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java
----------------------------------------------------------------------
diff --git a/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java
b/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java
index d75cc1a..b898b4a 100644
--- a/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java
+++ b/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java
@@ -128,11 +128,11 @@ class ObjRelationshipValidator extends ConfigurationNodeValidator {
 
         if(!relationship.isToPK()) {
             ObjRelationship reverseRelationship = relationship.getReverseRelationship();
-            if(reverseRelationship == null || !reverseRelationship.isToPK()) {
+            if(reverseRelationship != null && !reverseRelationship.isToPK()) {
                 addFailure(
                         validationResult,
                         relationship,
-                        "ObjRelationship '%s' has join not to PK. Cayenne doesn't allow this
type of relashioships",
+                        "ObjRelationship '%s' has join not to PK. Cayenne doesn't allow this
type of relationship",
                         toString(relationship));
             }
         }


Mime
View raw message