This is an automated email from the ASF dual-hosted git repository.
ntimofeev pushed a commit to branch STABLE-4.1
in repository https://gitbox.apache.org/repos/asf/cayenne.git
The following commit(s) were added to refs/heads/STABLE-4.1 by this push:
new 4d2f8c0 CAY-2533 Modeler: Exception on validating ObjRelationship
without db path
4d2f8c0 is described below
commit 4d2f8c0450115baeee0fef208e61ca057dfc1696
Author: Nikita Timofeev <[email protected]>
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 115feb7..4988f26 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -57,6 +57,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));
}
}