cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [3/4] cayenne git commit: Merge remote-tracking branch 'remotes/parent/pr/200' into asf-master This closes #200
Date Tue, 18 Apr 2017 15:35:31 GMT
Merge remote-tracking branch 'remotes/parent/pr/200' into asf-master
This closes #200


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

Branch: refs/heads/master
Commit: 70ace3001afeb48b981e98f26a252a09dc0c6c85
Parents: 8f2e886 1c69c88
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Tue Apr 18 18:27:44 2017 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Tue Apr 18 18:27:44 2017 +0300

----------------------------------------------------------------------
 .../project/validation/DbRelationshipValidator.java   | 14 ++++++++++++++
 docs/doc/src/main/resources/RELEASE-NOTES.txt         |  3 ++-
 2 files changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/70ace300/cayenne-project/src/main/java/org/apache/cayenne/project/validation/DbRelationshipValidator.java
----------------------------------------------------------------------
diff --cc cayenne-project/src/main/java/org/apache/cayenne/project/validation/DbRelationshipValidator.java
index b865e80,03caada..4f435bc
--- 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
@@@ -95,19 -95,20 +95,33 @@@ class DbRelationshipValidator extends C
  
          checkForDuplicates(relationship, validationResult);
          checkOnGeneratedStrategyConflict(relationship, validationResult);
+         checkToMany(relationship, validationResult);
+ }
+ 
+ 
+     private void checkToMany(DbRelationship relationship, ValidationResult validationResult)
{
+         if (relationship != null && relationship.getReverseRelationship() != null)
{
+             if (relationship.isToMany() && relationship.getReverseRelationship().isToMany())
{
+                 addFailure(
+                         validationResult,
+                         relationship,
+                         "Relationship '%s' and '%s' ManyToMany is impossible",
+                         relationship.getName(), relationship.getReverseRelationship().getName());
+             }
+         }
 +        checkTypesOfAttributesInRelationship(relationship, validationResult);
 +    }
 +
 +    private void checkTypesOfAttributesInRelationship(DbRelationship relationship, ValidationResult
validationResult) {
 +        for (DbJoin join: relationship.getJoins()) {
 +            if (join.getSource().getType() != join.getTarget().getType()) {
 +                addFailure(
 +                        validationResult,
 +                        relationship,
 +                        "Attributes '%s' and '%s' have different types in a relationship
'%s'",
 +                        join.getSourceName(), join.getTargetName(), relationship.getName());
 +            }
 +        }
      }
  
      private void checkOnGeneratedStrategyConflict(DbRelationship relationship, ValidationResult
validationResult) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/70ace300/docs/doc/src/main/resources/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --cc docs/doc/src/main/resources/RELEASE-NOTES.txt
index 04742d2,a3baf81..00a9ef4
--- a/docs/doc/src/main/resources/RELEASE-NOTES.txt
+++ b/docs/doc/src/main/resources/RELEASE-NOTES.txt
@@@ -14,8 -14,8 +14,9 @@@ Date
  Changes/New Features:
  
  CAY-1873 Move DataDomain cache configuration from the Modeler and into DI
+ CAY-1891 Add To-Many / To-One Warnings to Cayenne Modeler
 +CAY-2057 Clean up OS X Modeler
- CAY-2109 cayenne-crypto: add value authentication (HMAC) 
+ CAY-2109 cayenne-crypto: add value authentication (HMAC)
  CAY-2210 Query cache: incorrect cache key for queries with custom value objects
  CAY-2255 ObjectSelect improvement: columns as full entities
  CAY-2258 DI: type-safe binding of List and Map


Mime
View raw message