This is an automated email from the ASF dual-hosted git repository.
pinal pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 9ad412037 ATLAS-4678 : Restrict Relationship Typedef creation if
relationshipCategory value is not provided
9ad412037 is described below
commit 9ad4120371545d9281c3fd0a4a8b78a2b54e490b
Author: Mandar Ambawane <[email protected]>
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 <[email protected]>
(cherry picked from commit d2f8933843ebdb64f29d13212065e71a6d3df6cd)
---
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);
}