You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by pi...@apache.org on 2022/10/11 05:42:02 UTC
[atlas] branch master updated: ATLAS-4678 : Restrict Relationship Typedef creation if relationshipCategory value is not provided
This is an automated email from the ASF dual-hosted git repository.
pinal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new d2f893384 ATLAS-4678 : Restrict Relationship Typedef creation if relationshipCategory value is not provided
d2f893384 is described below
commit d2f8933843ebdb64f29d13212065e71a6d3df6cd
Author: Mandar Ambawane <ma...@freestoneinfotech.com>
AuthorDate: Mon Oct 10 16:07:04 2022 +0530
ATLAS-4678 : Restrict Relationship Typedef creation if relationshipCategory value is not provided
Signed-off-by: Pinal Shah <pi...@freestoneinfotech.com>
---
intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java b/intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
index 5b1737b70..e604df7a1 100644
--- a/intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
+++ b/intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
@@ -311,8 +311,9 @@ public class AtlasRelationshipType extends AtlasStructType {
throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_DOUBLE_CONTAINERS, name);
}
if ((isContainer1 || isContainer2)) {
- // we have an isContainer defined in an end
- if (relationshipCategory == RelationshipCategory.ASSOCIATION) {
+ // we have an isContainer defined in an end.
+ // the default relationshipCategory is ASSOCIATION.
+ if (relationshipCategory == null || relationshipCategory == RelationshipCategory.ASSOCIATION) {
// associations are not containment relationships - so do not allow an endpoint with isContainer
throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_ASSOCIATION_AND_CONTAINER, name);
}