You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by ab...@apache.org on 2019/03/06 08:43:52 UTC

[cayenne] branch master updated (40a2298 -> 40b991b)

This is an automated email from the ASF dual-hosted git repository.

abulatski pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git.


    from 40a2298  CAY-2531 Importing same schema after Import Revert clears all entities in datamap
     new 45beebd  CAY-2533 Modeler: Exception on validating ObjRelationship without db path
     new 40b991b  CAY-2533 Modeler: Exception on validating ObjRelationship without db path

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 RELEASE-NOTES.txt                                                   | 1 +
 .../apache/cayenne/project/validation/ObjRelationshipValidator.java | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)


[cayenne] 02/02: CAY-2533 Modeler: Exception on validating ObjRelationship without db path

Posted by ab...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

abulatski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git

commit 40b991b14a7633a87eae4955ccae65c22550120a
Author: Arseni Bulatski <an...@gmail.com>
AuthorDate: Wed Mar 6 11:40:57 2019 +0300

    CAY-2533 Modeler: Exception on validating ObjRelationship without db path
---
 RELEASE-NOTES.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 1224677..9855398 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -31,6 +31,7 @@ CAY-2332 Property API: unable to use eq() and in() methods for toMany relationsh
 CAY-2509 Result of resolving lazily faulted relationships can be out-of-date
 CAY-2530 DB Import and Class Generation from Project is performed for removed datamaps
 CAY-2531 Importing same schema after Import Revert clears all entities in datamap
+CAY-2533 Modeler: Exception on validating ObjRelationship without db path
 CAY-2544 Possible name clash of ivar and property name in generated class
 CAY-2547 CayenneDataObject serialization issue
 
@@ -83,7 +84,6 @@ CAY-2501 Modeler: DbImport ui not loading columns for MySQL connector v8.0
 CAY-2502 DataMap in DataNode tree view disappears after dbImport
 CAY-2504 Broken detection logic of NoopEventBridge in DataRowStoreFactory
 CAY-2505 EventBridge providers should be bound without scope
-CAY-2533 Modeler: Exception on validating ObjRelationship without db path
 
 ----------------------------------
 Release: 4.1.M2


[cayenne] 01/02: CAY-2533 Modeler: Exception on validating ObjRelationship without db path

Posted by ab...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

abulatski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git

commit 45beebd838b14a3fcfce665435b1b5f6ffc2abaf
Author: Nikita Timofeev <st...@gmail.com>
AuthorDate: Mon Feb 11 15:01:49 2019 +0300

    CAY-2533 Modeler: Exception on validating ObjRelationship without db path
---
 RELEASE-NOTES.txt                                                   | 1 +
 .../apache/cayenne/project/validation/ObjRelationshipValidator.java | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 5a63a04..1224677 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -83,6 +83,7 @@ CAY-2501 Modeler: DbImport ui not loading columns for MySQL connector v8.0
 CAY-2502 DataMap in DataNode tree view disappears after dbImport
 CAY-2504 Broken detection logic of NoopEventBridge in DataRowStoreFactory
 CAY-2505 EventBridge providers should be bound without scope
+CAY-2533 Modeler: Exception on validating ObjRelationship without db path
 
 ----------------------------------
 Release: 4.1.M2
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 b898b4a..a3b7f31 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
@@ -126,13 +126,13 @@ class ObjRelationshipValidator extends ConfigurationNodeValidator {
             }
         }
 
-        if(!relationship.isToPK()) {
+        if(!relationship.getDbRelationships().isEmpty() && !relationship.isToPK()) {
             ObjRelationship reverseRelationship = relationship.getReverseRelationship();
-            if(reverseRelationship != null && !reverseRelationship.isToPK()) {
+            if(reverseRelationship != null && !relationship.getDbRelationships().isEmpty() && !reverseRelationship.isToPK()) {
                 addFailure(
                         validationResult,
                         relationship,
-                        "ObjRelationship '%s' has join not to PK. Cayenne doesn't allow this type of relationship",
+                        "ObjRelationship '%s' has join not to PK. This is not fully supported by Cayenne.",
                         toString(relationship));
             }
         }