Commit 1de6016d by David Radley Committed by Madhan Neethiraj

ATLAS-1873: renamed AtlasRelationshipEndPoint to AtlasRelationshipEnd

parent c2c05d67
...@@ -58,8 +58,8 @@ public final class Constants { ...@@ -58,8 +58,8 @@ public final class Constants {
public static final String TYPEOPTIONS_PROPERTY_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "type.options"; public static final String TYPEOPTIONS_PROPERTY_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "type.options";
// relationship def constants // relationship def constants
public static final String RELATIONSHIPTYPE_ENDPOINT1_KEY = "endPointDef1"; public static final String RELATIONSHIPTYPE_END1_KEY = "endDef1";
public static final String RELATIONSHIPTYPE_ENDPOINT2_KEY = "endPointDef2"; public static final String RELATIONSHIPTYPE_END2_KEY = "endDef2";
public static final String RELATIONSHIPTYPE_CATEGORY_KEY = "relationshipCategory"; public static final String RELATIONSHIPTYPE_CATEGORY_KEY = "relationshipCategory";
public static final String RELATIONSHIPTYPE_TAG_PROPAGATION_KEY = "tagPropagation"; public static final String RELATIONSHIPTYPE_TAG_PROPAGATION_KEY = "tagPropagation";
/** /**
......
...@@ -71,14 +71,14 @@ public enum AtlasErrorCode { ...@@ -71,14 +71,14 @@ public enum AtlasErrorCode {
BAD_REQUEST(400, "ATLAS-400-00-029", "{0}"), BAD_REQUEST(400, "ATLAS-400-00-029", "{0}"),
PARAMETER_PARSING_FAILED(400, "ATLAS-400-00-02A", "Parameter parsing failed at: {0}"), PARAMETER_PARSING_FAILED(400, "ATLAS-400-00-02A", "Parameter parsing failed at: {0}"),
MISSING_MANDATORY_ATTRIBUTE(400, "ATLAS-400-00-02B", "Mandatory field {0}.{1} has empty/null value"), MISSING_MANDATORY_ATTRIBUTE(400, "ATLAS-400-00-02B", "Mandatory field {0}.{1} has empty/null value"),
RELATIONSHIPDEF_INSUFFICIENT_ENDPOINTS(400, "ATLAS-400-00-02C", "Relationship def {0} creation attempted without 2 end points"), RELATIONSHIPDEF_INSUFFICIENT_ENDS(400, "ATLAS-400-00-02C", "relationshipDef {0} creation attempted without 2 ends"),
RELATIONSHIPDEF_DOUBLE_CONTAINERS(400, "ATLAS-400-00-02D", "Relationship def {0} creation attempted with both end points as containers"), RELATIONSHIPDEF_DOUBLE_CONTAINERS(400, "ATLAS-400-00-02D", "relationshipDef {0} creation attempted with both ends as containers"),
RELATIONSHIPDEF_UNSUPPORTED_ATTRIBUTE_TYPE(400, "ATLAS-400-00-02F", "Cannot set an Attribute with type {0} on relationship def {1}, as it is not a primitive type "), RELATIONSHIPDEF_UNSUPPORTED_ATTRIBUTE_TYPE(400, "ATLAS-400-00-02F", "Cannot set an Attribute with type {0} on relationship def {1}, as it is not a primitive type "),
RELATIONSHIPDEF_ASSOCIATION_AND_CONTAINER(400, "ATLAS-400-00-030", "ASSOCIATION relationship def {0} creation attempted with an endpoint specifying isContainer"), RELATIONSHIPDEF_ASSOCIATION_AND_CONTAINER(400, "ATLAS-400-00-030", "ASSOCIATION relationshipDef {0} creation attempted with an end specifying isContainer"),
RELATIONSHIPDEF_COMPOSITION_NO_CONTAINER(400, "ATLAS-400-00-031", "COMPOSITION relationship def {0} creation attempted without an endpoint specifying isContainer"), RELATIONSHIPDEF_COMPOSITION_NO_CONTAINER(400, "ATLAS-400-00-031", "COMPOSITION relationshipDef {0} creation attempted without an end specifying isContainer"),
RELATIONSHIPDEF_AGGREGATION_NO_CONTAINER(400, "ATLAS-400-00-032", "AGGREGATION relationship def {0} creation attempted without an endpoint specifying isContainer"), RELATIONSHIPDEF_AGGREGATION_NO_CONTAINER(400, "ATLAS-400-00-032", "AGGREGATION relationshipDef {0} creation attempted without an end specifying isContainer"),
RELATIONSHIPDEF_COMPOSITION_SET_CONTAINER(400, "ATLAS-400-00-033", "COMPOSITION relationship def {0} cannot have a SET cardinality and be a container"), RELATIONSHIPDEF_COMPOSITION_SET_CONTAINER(400, "ATLAS-400-00-033", "COMPOSITION relationshipDef {0} cannot have a SET cardinality and be a container"),
RELATIONSHIPDEF_LIST_ON_ENDPOINT(400, "ATLAS-400-00-034", "relationship def {0} cannot have a LIST cardinality on an endpoint"), RELATIONSHIPDEF_LIST_ON_END(400, "ATLAS-400-00-034", "relationshipDef {0} cannot have a LIST cardinality on an end"),
// All Not found enums go here // All Not found enums go here
TYPE_NAME_NOT_FOUND(404, "ATLAS-404-00-001", "Given typename {0} was invalid"), TYPE_NAME_NOT_FOUND(404, "ATLAS-404-00-001", "Given typename {0} was invalid"),
TYPE_GUID_NOT_FOUND(404, "ATLAS-404-00-002", "Given type guid {0} was invalid"), TYPE_GUID_NOT_FOUND(404, "ATLAS-404-00-002", "Given type guid {0} was invalid"),
......
...@@ -39,8 +39,8 @@ import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONL ...@@ -39,8 +39,8 @@ import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONL
* As with other typeDefs the AtlasRelationshipDef has a name. Once created the RelationshipDef has a guid. * As with other typeDefs the AtlasRelationshipDef has a name. Once created the RelationshipDef has a guid.
* The name and the guid are the 2 ways that the RelationshipDef is identified. * The name and the guid are the 2 ways that the RelationshipDef is identified.
* *
* RelationshipDefs have 2 endpoints, each of which specify cardinality, an EntityDef type name and name and optionally * RelationshipDefs have 2 ends, each of which specify cardinality, an EntityDef type name and name and optionally
* whether the endpoint is a container. * whether the end is a container.
* RelationshipDefs can have AttributeDefs - though only primitive types are allowed. * RelationshipDefs can have AttributeDefs - though only primitive types are allowed.
* RelationshipDefs have a relationshipCategory specifying the UML type of relationship required * RelationshipDefs have a relationshipCategory specifying the UML type of relationship required
* RelationshipDefs also have a PropogateTag - indicating which way tags could flow over the relationships. * RelationshipDefs also have a PropogateTag - indicating which way tags could flow over the relationships.
...@@ -51,9 +51,9 @@ import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONL ...@@ -51,9 +51,9 @@ import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONL
* RelationshipDefs introduce new atributes to the entity instances. For example * RelationshipDefs introduce new atributes to the entity instances. For example
* EntityDef A might have attributes attr1,attr2,attr3 * EntityDef A might have attributes attr1,attr2,attr3
* EntityDef B might have attributes attr4,attr5,attr6 * EntityDef B might have attributes attr4,attr5,attr6
* RelationshipDef AtoB might define 2 endpoints * RelationshipDef AtoB might define 2 ends
* endpoint1: type A, name attr7 * end1: type A, name attr7
* endpoint1: type B, name attr8 * end1: type B, name attr8
* *
* When an instance of EntityDef A is created, it will have attributes attr1,attr2,attr3,attr7 * When an instance of EntityDef A is created, it will have attributes attr1,attr2,attr3,attr7
* When an instance of EntityDef B is created, it will have attributes attr4,attr5,attr6,attr8 * When an instance of EntityDef B is created, it will have attributes attr4,attr5,attr6,attr8
...@@ -88,11 +88,11 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri ...@@ -88,11 +88,11 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri
* PropagateTags indicates whether tags should propagate across the relationship instance. * PropagateTags indicates whether tags should propagate across the relationship instance.
* Tags can propagate: * Tags can propagate:
* NONE - not at all * NONE - not at all
* ONE_TO_TWO - from endpoint 1 to 2 * ONE_TO_TWO - from end 1 to 2
* TWO_TO_ONE - from endpoint 2 to 1 * TWO_TO_ONE - from end 2 to 1
* BOTH - both ways * BOTH - both ways
* *
* Care needs to be taken when specifying. The use cases we are aware of this flag being useful are : * Care needs to be taken when specifying. The use cases we are aware of where this flag is useful:
* *
* - propagating confidentiality classifications from a table to columns - ONE_TO_TWO could be used here * - propagating confidentiality classifications from a table to columns - ONE_TO_TWO could be used here
* - propagating classifications around Glossary synonyms - BOTH could be used here. * - propagating classifications around Glossary synonyms - BOTH could be used here.
...@@ -106,8 +106,8 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri ...@@ -106,8 +106,8 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri
private RelationshipCategory relationshipCategory; private RelationshipCategory relationshipCategory;
private PropagateTags propagateTags; private PropagateTags propagateTags;
private AtlasRelationshipEndPointDef endPointDef1; private AtlasRelationshipEndDef endDef1;
private AtlasRelationshipEndPointDef endPointDef2; private AtlasRelationshipEndDef endDef2;
/** /**
* AtlasRelationshipDef contructor * AtlasRelationshipDef contructor
...@@ -130,22 +130,23 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri ...@@ -130,22 +130,23 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri
* and AGGREGATION * and AGGREGATION
* @param propagatetags * @param propagatetags
* - * -
* @param endPointDef1 * @param endDef1
* - first endpoint. As endpoint specifies an entity * - first end. An end specifies an entity type and an attribute name. the attribute name then appears in
* type and an attribute name. the attribute name then appears in
* the relationship instance * the relationship instance
* @param endPointDef2 * @param endDef2
* - second endpoint. The endpoints are defined as 1 * - second end. An end specifies an entity type and an attribute name. the attribute name then appears in
* ad 2 to avoid implying a direction. So we do not use to and * the relationship instance
* from. *
* The ends are defined as 1 and 2 to avoid implying a direction. So we do not use to and from.
*
* @throws AtlasBaseException * @throws AtlasBaseException
*/ */
public AtlasRelationshipDef(String name, String description, String typeVersion, public AtlasRelationshipDef(String name, String description, String typeVersion,
RelationshipCategory relationshipCategory, RelationshipCategory relationshipCategory,
PropagateTags propagatetags, PropagateTags propagatetags,
AtlasRelationshipEndPointDef endPointDef1, AtlasRelationshipEndDef endDef1,
AtlasRelationshipEndPointDef endPointDef2) throws AtlasBaseException { AtlasRelationshipEndDef endDef2) throws AtlasBaseException {
this(name, description, typeVersion, relationshipCategory,propagatetags, endPointDef1, endPointDef2, this(name, description, typeVersion, relationshipCategory,propagatetags, endDef1, endDef2,
new ArrayList<AtlasAttributeDef>()); new ArrayList<AtlasAttributeDef>());
} }
...@@ -162,12 +163,12 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri ...@@ -162,12 +163,12 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri
* and AGGREGATION * and AGGREGATION
* @param propagatetags * @param propagatetags
* - * -
* @param endPointDef1 * @param endDef1
* - First endpoint. As endpoint specifies an entity * - First end. As end specifies an entity
* type and an attribute name. the attribute name then appears in * type and an attribute name. the attribute name then appears in
* the relationship instance * the relationship instance
* @param endPointDef2 * @param endDef2
* - Second endpoint. The endpoints are defined as 1 * - Second end. The ends are defined as 1
* ad 2 to avoid implying a direction. So we do not use to and * ad 2 to avoid implying a direction. So we do not use to and
* from. * from.
* @param attributeDefs * @param attributeDefs
...@@ -175,15 +176,15 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri ...@@ -175,15 +176,15 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri
*/ */
public AtlasRelationshipDef(String name, String description, String typeVersion, public AtlasRelationshipDef(String name, String description, String typeVersion,
RelationshipCategory relationshipCategory, RelationshipCategory relationshipCategory,
PropagateTags propagatetags, AtlasRelationshipEndPointDef endPointDef1, PropagateTags propagatetags, AtlasRelationshipEndDef endDef1,
AtlasRelationshipEndPointDef endPointDef2, List<AtlasAttributeDef> attributeDefs) AtlasRelationshipEndDef endDef2, List<AtlasAttributeDef> attributeDefs)
{ {
super(TypeCategory.RELATIONSHIP, name, description, typeVersion, attributeDefs, null); super(TypeCategory.RELATIONSHIP, name, description, typeVersion, attributeDefs, null);
setRelationshipCategory(relationshipCategory); setRelationshipCategory(relationshipCategory);
setPropagateTags(propagatetags); setPropagateTags(propagatetags);
setEndPointDef1(endPointDef1); setEndDef1(endDef1);
setEndPointDef2(endPointDef2); setEndDef2(endDef2);
} }
public void setRelationshipCategory(RelationshipCategory relationshipCategory) { public void setRelationshipCategory(RelationshipCategory relationshipCategory) {
...@@ -202,20 +203,20 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri ...@@ -202,20 +203,20 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri
return this.propagateTags; return this.propagateTags;
} }
public void setEndPointDef1(AtlasRelationshipEndPointDef endPointDef1) { public void setEndDef1(AtlasRelationshipEndDef endDef1) {
this.endPointDef1 = endPointDef1; this.endDef1 = endDef1;
} }
public AtlasRelationshipEndPointDef getEndPointDef1() { public AtlasRelationshipEndDef getEndDef1() {
return this.endPointDef1; return this.endDef1;
} }
public void setEndPointDef2(AtlasRelationshipEndPointDef endPointDef2) { public void setEndDef2(AtlasRelationshipEndDef endDef2) {
this.endPointDef2 = endPointDef2; this.endDef2 = endDef2;
} }
public AtlasRelationshipEndPointDef getEndPointDef2() { public AtlasRelationshipEndDef getEndDef2() {
return this.endPointDef2; return this.endDef2;
} }
public AtlasRelationshipDef(AtlasRelationshipDef other) throws AtlasBaseException { public AtlasRelationshipDef(AtlasRelationshipDef other) throws AtlasBaseException {
...@@ -224,8 +225,8 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri ...@@ -224,8 +225,8 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri
if (other != null) { if (other != null) {
setRelationshipCategory(other.getRelationshipCategory()); setRelationshipCategory(other.getRelationshipCategory());
setPropagateTags(other.getPropagateTags()); setPropagateTags(other.getPropagateTags());
setEndPointDef1(other.getEndPointDef1()); setEndDef1(other.getEndDef1());
setEndPointDef2(other.getEndPointDef2()); setEndDef2(other.getEndDef2());
} }
} }
@Override @Override
...@@ -241,9 +242,9 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri ...@@ -241,9 +242,9 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri
sb.append(','); sb.append(',');
sb.append(this.propagateTags); sb.append(this.propagateTags);
sb.append(','); sb.append(',');
sb.append(this.endPointDef1.toString()); sb.append(this.endDef1.toString());
sb.append(','); sb.append(',');
sb.append(this.endPointDef2.toString()); sb.append(this.endDef2.toString());
sb.append('}'); sb.append('}');
return sb; return sb;
} }
...@@ -262,14 +263,14 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri ...@@ -262,14 +263,14 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri
return false; return false;
if (!Objects.equals(propagateTags, that.getPropagateTags())) if (!Objects.equals(propagateTags, that.getPropagateTags()))
return false; return false;
if (!Objects.equals(endPointDef1, that.getEndPointDef1())) if (!Objects.equals(endDef1, that.getEndDef1()))
return false; return false;
return (Objects.equals(endPointDef2, that.getEndPointDef2())); return (Objects.equals(endDef2, that.getEndDef2()));
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(super.hashCode(), relationshipCategory, propagateTags, endPointDef1, endPointDef2); return Objects.hash(super.hashCode(), relationshipCategory, propagateTags, endDef1, endDef2);
} }
@Override @Override
......
...@@ -32,7 +32,7 @@ import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.NONE; ...@@ -32,7 +32,7 @@ import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.NONE;
import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONLY; import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONLY;
/** /**
* The relationshipEndPointsDef represents an end of the relationship. The end of the relationship is defined by a type, an * The relationshipEndDef represents an end of the relationship. The end of the relationship is defined by a type, an
* attribute name, cardinality and whether it is the container end of the relationship. * attribute name, cardinality and whether it is the container end of the relationship.
*/ */
@JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) @JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE)
...@@ -40,14 +40,14 @@ import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONL ...@@ -40,14 +40,14 @@ import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONL
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.PROPERTY) @XmlAccessorType(XmlAccessType.PROPERTY)
public class AtlasRelationshipEndPointDef implements Serializable { public class AtlasRelationshipEndDef implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* The type associated with the endpoint. * The type associated with the end.
*/ */
private String type; private String type;
/** /**
* The name of the attribute for this endpoint * The name of the attribute for this end
*/ */
private String name; private String name;
...@@ -56,14 +56,14 @@ public class AtlasRelationshipEndPointDef implements Serializable { ...@@ -56,14 +56,14 @@ public class AtlasRelationshipEndPointDef implements Serializable {
*/ */
private boolean isContainer; private boolean isContainer;
/** /**
* This is the cardinality of the end point * This is the cardinality of the end
*/ */
private Cardinality cardinality; private Cardinality cardinality;
/** /**
* Base constructor * Base constructor
*/ */
public AtlasRelationshipEndPointDef() { public AtlasRelationshipEndDef() {
this(null, null, Cardinality.SINGLE, false); this(null, null, Cardinality.SINGLE, false);
} }
...@@ -74,9 +74,9 @@ public class AtlasRelationshipEndPointDef implements Serializable { ...@@ -74,9 +74,9 @@ public class AtlasRelationshipEndPointDef implements Serializable {
* @param name * @param name
* - The name of the new attribute that the entity instance will pick up. * - The name of the new attribute that the entity instance will pick up.
* @param cardinality * @param cardinality
* - this indicates whether the end point is SINGLE (1) or SET (many) * - this indicates whether the end is SINGLE (1) or SET (many)
*/ */
public AtlasRelationshipEndPointDef(String typeName, String name, Cardinality cardinality) { public AtlasRelationshipEndDef(String typeName, String name, Cardinality cardinality) {
this(typeName, name, cardinality, false); this(typeName, name, cardinality, false);
} }
...@@ -87,11 +87,11 @@ public class AtlasRelationshipEndPointDef implements Serializable { ...@@ -87,11 +87,11 @@ public class AtlasRelationshipEndPointDef implements Serializable {
* @param name * @param name
* - The name of the new attribute that the entity instance will pick up. * - The name of the new attribute that the entity instance will pick up.
* @param cardinality * @param cardinality
* - whether the end point is SINGLE (1) or SET (many) * - whether the end is SINGLE (1) or SET (many)
* @param isContainer * @param isContainer
* - whether the end point is a container or not * - whether the end is a container or not
*/ */
public AtlasRelationshipEndPointDef(String typeName, String name, Cardinality cardinality, boolean isContainer) { public AtlasRelationshipEndDef(String typeName, String name, Cardinality cardinality, boolean isContainer) {
setType(typeName); setType(typeName);
setName(name); setName(name);
setCardinality(cardinality); setCardinality(cardinality);
...@@ -115,7 +115,7 @@ public class AtlasRelationshipEndPointDef implements Serializable { ...@@ -115,7 +115,7 @@ public class AtlasRelationshipEndPointDef implements Serializable {
} }
/** /**
* set whether this endpoint is a container or not. * set whether this end is a container or not.
* @param isContainer * @param isContainer
*/ */
public void setIsContainer(boolean isContainer) { public void setIsContainer(boolean isContainer) {
...@@ -127,7 +127,7 @@ public class AtlasRelationshipEndPointDef implements Serializable { ...@@ -127,7 +127,7 @@ public class AtlasRelationshipEndPointDef implements Serializable {
} }
/** /**
* set the cardinality SINGLE or SET on the endpoint. * set the cardinality SINGLE or SET on the end.
* @param cardinality * @param cardinality
*/ */
public void setCardinality(AtlasStructDef.AtlasAttributeDef.Cardinality cardinality) { public void setCardinality(AtlasStructDef.AtlasAttributeDef.Cardinality cardinality) {
...@@ -143,10 +143,10 @@ public class AtlasRelationshipEndPointDef implements Serializable { ...@@ -143,10 +143,10 @@ public class AtlasRelationshipEndPointDef implements Serializable {
} }
/** /**
* Construct using an existing AtlasRelationshipEndPointDef * Construct using an existing AtlasRelationshipEndDef
* @param other * @param other
*/ */
public AtlasRelationshipEndPointDef(AtlasRelationshipEndPointDef other) { public AtlasRelationshipEndDef(AtlasRelationshipEndDef other) {
if (other != null) { if (other != null) {
setType(other.getType()); setType(other.getType());
setName(other.getName()); setName(other.getName());
...@@ -160,7 +160,7 @@ public class AtlasRelationshipEndPointDef implements Serializable { ...@@ -160,7 +160,7 @@ public class AtlasRelationshipEndPointDef implements Serializable {
sb = new StringBuilder(); sb = new StringBuilder();
} }
sb.append("AtlasRelationshipEndPointsDef{"); sb.append("AtlasRelationshipEndDef{");
sb.append("type='").append(type).append('\''); sb.append("type='").append(type).append('\'');
sb.append(", name==>'").append(name).append('\''); sb.append(", name==>'").append(name).append('\'');
sb.append(", isContainer==>'").append(isContainer).append('\''); sb.append(", isContainer==>'").append(isContainer).append('\'');
...@@ -176,7 +176,7 @@ public class AtlasRelationshipEndPointDef implements Serializable { ...@@ -176,7 +176,7 @@ public class AtlasRelationshipEndPointDef implements Serializable {
return true; return true;
if (o == null || getClass() != o.getClass()) if (o == null || getClass() != o.getClass())
return false; return false;
AtlasRelationshipEndPointDef that = (AtlasRelationshipEndPointDef) o; AtlasRelationshipEndDef that = (AtlasRelationshipEndDef) o;
return Objects.equals(type, that.type) && Objects.equals(name, that.name) return Objects.equals(type, that.type) && Objects.equals(name, that.name)
&& (isContainer == that.isContainer) && (cardinality == that.cardinality); && (isContainer == that.isContainer) && (cardinality == that.cardinality);
} }
......
...@@ -22,7 +22,7 @@ import org.apache.atlas.AtlasErrorCode; ...@@ -22,7 +22,7 @@ import org.apache.atlas.AtlasErrorCode;
import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.exception.AtlasBaseException;
import org.apache.atlas.model.typedef.AtlasRelationshipDef; import org.apache.atlas.model.typedef.AtlasRelationshipDef;
import org.apache.atlas.model.typedef.AtlasRelationshipDef.RelationshipCategory; import org.apache.atlas.model.typedef.AtlasRelationshipDef.RelationshipCategory;
import org.apache.atlas.model.typedef.AtlasRelationshipEndPointDef; import org.apache.atlas.model.typedef.AtlasRelationshipEndDef;
import org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef; import org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -103,10 +103,10 @@ public class AtlasRelationshipType extends AtlasStructType { ...@@ -103,10 +103,10 @@ public class AtlasRelationshipType extends AtlasStructType {
* @throws AtlasBaseException * @throws AtlasBaseException
*/ */
public static void validateAtlasRelationshipDef(AtlasRelationshipDef relationshipDef) throws AtlasBaseException { public static void validateAtlasRelationshipDef(AtlasRelationshipDef relationshipDef) throws AtlasBaseException {
AtlasRelationshipEndPointDef endPointDef1 = relationshipDef.getEndPointDef1(); AtlasRelationshipEndDef endDef1 = relationshipDef.getEndDef1();
AtlasRelationshipEndPointDef endPointDef2 = relationshipDef.getEndPointDef2(); AtlasRelationshipEndDef endDef2 = relationshipDef.getEndDef2();
boolean isContainer1 = endPointDef1.getIsContainer(); boolean isContainer1 = endDef1.getIsContainer();
boolean isContainer2 = endPointDef2.getIsContainer(); boolean isContainer2 = endDef2.getIsContainer();
RelationshipCategory relationshipCategory = relationshipDef.getRelationshipCategory(); RelationshipCategory relationshipCategory = relationshipDef.getRelationshipCategory();
String name = relationshipDef.getName(); String name = relationshipDef.getName();
...@@ -115,37 +115,37 @@ public class AtlasRelationshipType extends AtlasStructType { ...@@ -115,37 +115,37 @@ public class AtlasRelationshipType extends AtlasStructType {
throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_DOUBLE_CONTAINERS, name); throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_DOUBLE_CONTAINERS, name);
} }
if ((isContainer1 || isContainer2)) { if ((isContainer1 || isContainer2)) {
// we have an isContainer defined in an endpoint // we have an isContainer defined in an end
if (relationshipCategory == RelationshipCategory.ASSOCIATION) { if (relationshipCategory == RelationshipCategory.ASSOCIATION) {
// associations are not containment relaitonships - so do not allow an endpoiint with isContainer // associations are not containment relaitonships - so do not allow an endpoiint with isContainer
throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_ASSOCIATION_AND_CONTAINER, name); throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_ASSOCIATION_AND_CONTAINER, name);
} }
} else { } else {
// we do not have an isContainer defined in an endpoint // we do not have an isContainer defined in an end
if (relationshipCategory == RelationshipCategory.COMPOSITION) { if (relationshipCategory == RelationshipCategory.COMPOSITION) {
// COMPOSITION needs one endpoint to be the container. // COMPOSITION needs one end to be the container.
throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_COMPOSITION_NO_CONTAINER, name); throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_COMPOSITION_NO_CONTAINER, name);
} else if (relationshipCategory == RelationshipCategory.AGGREGATION) { } else if (relationshipCategory == RelationshipCategory.AGGREGATION) {
// AGGREGATION needs one endpoint to be the container. // AGGREGATION needs one end to be the container.
throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_AGGREGATION_NO_CONTAINER, name); throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_AGGREGATION_NO_CONTAINER, name);
} }
} }
if (relationshipCategory == RelationshipCategory.COMPOSITION) { if (relationshipCategory == RelationshipCategory.COMPOSITION) {
// composition containers should not be multiple cardinality // composition containers should not be multiple cardinality
if (endPointDef1 != null && if (endDef1 != null &&
endPointDef1.getCardinality() == AtlasAttributeDef.Cardinality.SET && endDef1.getCardinality() == AtlasAttributeDef.Cardinality.SET &&
endPointDef1.getIsContainer()) { endDef1.getIsContainer()) {
throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_COMPOSITION_SET_CONTAINER, name); throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_COMPOSITION_SET_CONTAINER, name);
} }
if (endPointDef2 != null && endPointDef2 != null && if (endDef2 != null && endDef2 != null &&
endPointDef2.getCardinality() == AtlasAttributeDef.Cardinality.SET && endDef2.getCardinality() == AtlasAttributeDef.Cardinality.SET &&
endPointDef2.getIsContainer()) { endDef2.getIsContainer()) {
throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_COMPOSITION_SET_CONTAINER, name); throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_COMPOSITION_SET_CONTAINER, name);
} }
} }
if ((endPointDef1 != null && endPointDef1.getCardinality() == AtlasAttributeDef.Cardinality.LIST) || if ((endDef1 != null && endDef1.getCardinality() == AtlasAttributeDef.Cardinality.LIST) ||
(endPointDef2 != null && endPointDef2.getCardinality() == AtlasAttributeDef.Cardinality.LIST)) { (endDef2 != null && endDef2.getCardinality() == AtlasAttributeDef.Cardinality.LIST)) {
throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_LIST_ON_ENDPOINT, name); throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_LIST_ON_END, name);
} }
} }
} }
...@@ -38,8 +38,8 @@ public class TestAtlasRelationshipDef { ...@@ -38,8 +38,8 @@ public class TestAtlasRelationshipDef {
@Test @Test
public void testRelationshipDefSerDeEmpty() throws AtlasBaseException { public void testRelationshipDefSerDeEmpty() throws AtlasBaseException {
AtlasRelationshipEndPointDef ep1 = new AtlasRelationshipEndPointDef("typeA", "attr1", Cardinality.SINGLE); AtlasRelationshipEndDef ep1 = new AtlasRelationshipEndDef("typeA", "attr1", Cardinality.SINGLE);
AtlasRelationshipEndPointDef ep2 = new AtlasRelationshipEndPointDef("typeB", "attr2", Cardinality.SINGLE); AtlasRelationshipEndDef ep2 = new AtlasRelationshipEndDef("typeB", "attr2", Cardinality.SINGLE);
AtlasRelationshipDef relationshipDef = new AtlasRelationshipDef("emptyRelationshipDef", "desc 1", "version1", AtlasRelationshipDef relationshipDef = new AtlasRelationshipDef("emptyRelationshipDef", "desc 1", "version1",
RelationshipCategory.ASSOCIATION, AtlasRelationshipDef.PropagateTags.ONE_TO_TWO, ep1, ep2); RelationshipCategory.ASSOCIATION, AtlasRelationshipDef.PropagateTags.ONE_TO_TWO, ep1, ep2);
...@@ -58,8 +58,8 @@ public class TestAtlasRelationshipDef { ...@@ -58,8 +58,8 @@ public class TestAtlasRelationshipDef {
@Test @Test
public void testRelationshipDefSerDeAttributes() throws AtlasBaseException { public void testRelationshipDefSerDeAttributes() throws AtlasBaseException {
AtlasRelationshipEndPointDef ep1 = new AtlasRelationshipEndPointDef("typeA", "attr1", Cardinality.SINGLE); AtlasRelationshipEndDef ep1 = new AtlasRelationshipEndDef("typeA", "attr1", Cardinality.SINGLE);
AtlasRelationshipEndPointDef ep2 = new AtlasRelationshipEndPointDef("typeB", "attr2", Cardinality.SINGLE); AtlasRelationshipEndDef ep2 = new AtlasRelationshipEndDef("typeB", "attr2", Cardinality.SINGLE);
AtlasRelationshipDef relationshipDef = new AtlasRelationshipDef("emptyRelationshipDef", "desc 1", "version1", AtlasRelationshipDef relationshipDef = new AtlasRelationshipDef("emptyRelationshipDef", "desc 1", "version1",
RelationshipCategory.ASSOCIATION, AtlasRelationshipDef.PropagateTags.ONE_TO_TWO, ep1, ep2); RelationshipCategory.ASSOCIATION, AtlasRelationshipDef.PropagateTags.ONE_TO_TWO, ep1, ep2);
relationshipDef.setAttributeDefs( relationshipDef.setAttributeDefs(
...@@ -77,8 +77,8 @@ public class TestAtlasRelationshipDef { ...@@ -77,8 +77,8 @@ public class TestAtlasRelationshipDef {
@Test @Test
public void testRelationshipEquals() throws AtlasBaseException { public void testRelationshipEquals() throws AtlasBaseException {
AtlasRelationshipEndPointDef ep1 = new AtlasRelationshipEndPointDef("typeA", "attr1", Cardinality.SINGLE); AtlasRelationshipEndDef ep1 = new AtlasRelationshipEndDef("typeA", "attr1", Cardinality.SINGLE);
AtlasRelationshipEndPointDef ep2 = new AtlasRelationshipEndPointDef("typeB", "attr2", Cardinality.SINGLE); AtlasRelationshipEndDef ep2 = new AtlasRelationshipEndDef("typeB", "attr2", Cardinality.SINGLE);
AtlasRelationshipDef relationshipDef1 = new AtlasRelationshipDef("emptyRelationshipDef", "desc 1", "version1", AtlasRelationshipDef relationshipDef1 = new AtlasRelationshipDef("emptyRelationshipDef", "desc 1", "version1",
RelationshipCategory.ASSOCIATION, AtlasRelationshipDef.PropagateTags.ONE_TO_TWO, ep1, ep2); RelationshipCategory.ASSOCIATION, AtlasRelationshipDef.PropagateTags.ONE_TO_TWO, ep1, ep2);
List<AtlasStructDef.AtlasAttributeDef> attributeDefs = ModelTestUtil.newAttributeDefsWithAllBuiltInTypesForRelationship(PREFIX_ATTRIBUTE_NAME); List<AtlasStructDef.AtlasAttributeDef> attributeDefs = ModelTestUtil.newAttributeDefsWithAllBuiltInTypesForRelationship(PREFIX_ATTRIBUTE_NAME);
......
...@@ -20,20 +20,20 @@ package org.apache.atlas.type; ...@@ -20,20 +20,20 @@ package org.apache.atlas.type;
import org.apache.atlas.AtlasErrorCode; import org.apache.atlas.AtlasErrorCode;
import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.exception.AtlasBaseException;
import org.apache.atlas.model.typedef.AtlasRelationshipDef; import org.apache.atlas.model.typedef.AtlasRelationshipDef;
import org.apache.atlas.model.typedef.AtlasRelationshipEndPointDef; import org.apache.atlas.model.typedef.AtlasRelationshipEndDef;
import org.apache.atlas.model.typedef.AtlasStructDef; import org.apache.atlas.model.typedef.AtlasStructDef;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import static org.testng.AssertJUnit.fail; import static org.testng.Assert.fail;
public class TestAtlasRelationshipType { public class TestAtlasRelationshipType {
@Test @Test
public void testvalidateAtlasRelationshipDef() throws AtlasBaseException { public void testvalidateAtlasRelationshipDef() throws AtlasBaseException {
AtlasRelationshipEndPointDef ep1 = new AtlasRelationshipEndPointDef("typeA", "attr1", AtlasStructDef.AtlasAttributeDef.Cardinality.SINGLE); AtlasRelationshipEndDef ep1 = new AtlasRelationshipEndDef("typeA", "attr1", AtlasStructDef.AtlasAttributeDef.Cardinality.SINGLE);
AtlasRelationshipEndPointDef ep2 = new AtlasRelationshipEndPointDef("typeB", "attr2", AtlasStructDef.AtlasAttributeDef.Cardinality.SINGLE); AtlasRelationshipEndDef ep2 = new AtlasRelationshipEndDef("typeB", "attr2", AtlasStructDef.AtlasAttributeDef.Cardinality.SINGLE);
AtlasRelationshipEndPointDef ep3 = new AtlasRelationshipEndPointDef("typeC", "attr2", AtlasStructDef.AtlasAttributeDef.Cardinality.SINGLE, true); AtlasRelationshipEndDef ep3 = new AtlasRelationshipEndDef("typeC", "attr2", AtlasStructDef.AtlasAttributeDef.Cardinality.SINGLE, true);
AtlasRelationshipEndPointDef ep4 = new AtlasRelationshipEndPointDef("typeD", "attr2", AtlasStructDef.AtlasAttributeDef.Cardinality.SINGLE, true); AtlasRelationshipEndDef ep4 = new AtlasRelationshipEndDef("typeD", "attr2", AtlasStructDef.AtlasAttributeDef.Cardinality.SINGLE, true);
AtlasRelationshipEndPointDef ep5 = new AtlasRelationshipEndPointDef("typeA", "attr1", AtlasStructDef.AtlasAttributeDef.Cardinality.SET,true); AtlasRelationshipEndDef ep5 = new AtlasRelationshipEndDef("typeA", "attr1", AtlasStructDef.AtlasAttributeDef.Cardinality.SET,true);
AtlasRelationshipEndPointDef ep6 = new AtlasRelationshipEndPointDef("typeA", "attr1", AtlasStructDef.AtlasAttributeDef.Cardinality.LIST,true); AtlasRelationshipEndDef ep6 = new AtlasRelationshipEndDef("typeA", "attr1", AtlasStructDef.AtlasAttributeDef.Cardinality.LIST,true);
AtlasRelationshipDef relationshipDef1 = new AtlasRelationshipDef("emptyRelationshipDef", "desc 1", "version1", AtlasRelationshipDef relationshipDef1 = new AtlasRelationshipDef("emptyRelationshipDef", "desc 1", "version1",
AtlasRelationshipDef.RelationshipCategory.ASSOCIATION, AtlasRelationshipDef.PropagateTags.ONE_TO_TWO, ep1, ep2); AtlasRelationshipDef.RelationshipCategory.ASSOCIATION, AtlasRelationshipDef.PropagateTags.ONE_TO_TWO, ep1, ep2);
AtlasRelationshipDef relationshipDef2 = new AtlasRelationshipDef("emptyRelationshipDef", "desc 1", "version1", AtlasRelationshipDef relationshipDef2 = new AtlasRelationshipDef("emptyRelationshipDef", "desc 1", "version1",
...@@ -88,7 +88,7 @@ public class TestAtlasRelationshipType { ...@@ -88,7 +88,7 @@ public class TestAtlasRelationshipType {
AtlasRelationshipType.validateAtlasRelationshipDef(relationshipDef); AtlasRelationshipType.validateAtlasRelationshipDef(relationshipDef);
fail("This call is expected to fail"); fail("This call is expected to fail");
} catch (AtlasBaseException abe) { } catch (AtlasBaseException abe) {
if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_LIST_ON_ENDPOINT)) { if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_LIST_ON_END)) {
fail("This call expected a different error"); fail("This call expected a different error");
} }
} }
...@@ -98,7 +98,7 @@ public class TestAtlasRelationshipType { ...@@ -98,7 +98,7 @@ public class TestAtlasRelationshipType {
AtlasRelationshipType.validateAtlasRelationshipDef(relationshipDef); AtlasRelationshipType.validateAtlasRelationshipDef(relationshipDef);
fail("This call is expected to fail"); fail("This call is expected to fail");
} catch (AtlasBaseException abe) { } catch (AtlasBaseException abe) {
if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_LIST_ON_ENDPOINT)) { if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_LIST_ON_END)) {
fail("This call expected a different error"); fail("This call expected a different error");
} }
} }
......
...@@ -22,7 +22,7 @@ import org.apache.atlas.exception.AtlasBaseException; ...@@ -22,7 +22,7 @@ import org.apache.atlas.exception.AtlasBaseException;
import org.apache.atlas.model.typedef.AtlasRelationshipDef; import org.apache.atlas.model.typedef.AtlasRelationshipDef;
import org.apache.atlas.model.typedef.AtlasRelationshipDef.RelationshipCategory; import org.apache.atlas.model.typedef.AtlasRelationshipDef.RelationshipCategory;
import org.apache.atlas.model.typedef.AtlasRelationshipDef.PropagateTags; import org.apache.atlas.model.typedef.AtlasRelationshipDef.PropagateTags;
import org.apache.atlas.model.typedef.AtlasRelationshipEndPointDef; import org.apache.atlas.model.typedef.AtlasRelationshipEndDef;
import org.apache.atlas.repository.Constants; import org.apache.atlas.repository.Constants;
import org.apache.atlas.repository.graphdb.AtlasVertex; import org.apache.atlas.repository.graphdb.AtlasVertex;
import org.apache.atlas.repository.store.graph.AtlasRelationshipDefStore; import org.apache.atlas.repository.store.graph.AtlasRelationshipDefStore;
...@@ -347,9 +347,9 @@ public class AtlasRelationshipDefStoreV1 extends AtlasAbstractDefStoreV1 impleme ...@@ -347,9 +347,9 @@ public class AtlasRelationshipDefStoreV1 extends AtlasAbstractDefStoreV1 impleme
private void updateVertexPreCreate(AtlasRelationshipDef relationshipDef, AtlasRelationshipType relationshipType, private void updateVertexPreCreate(AtlasRelationshipDef relationshipDef, AtlasRelationshipType relationshipType,
AtlasVertex vertex) throws AtlasBaseException { AtlasVertex vertex) throws AtlasBaseException {
AtlasStructDefStoreV1.updateVertexPreCreate(relationshipDef, relationshipType, vertex, typeDefStore); AtlasStructDefStoreV1.updateVertexPreCreate(relationshipDef, relationshipType, vertex, typeDefStore);
// Update endpoints // Update ends
vertex.setProperty(Constants.RELATIONSHIPTYPE_ENDPOINT1_KEY, AtlasType.toJson(relationshipDef.getEndPointDef1())); vertex.setProperty(Constants.RELATIONSHIPTYPE_END1_KEY, AtlasType.toJson(relationshipDef.getEndDef1()));
vertex.setProperty(Constants.RELATIONSHIPTYPE_ENDPOINT2_KEY, AtlasType.toJson(relationshipDef.getEndPointDef2())); vertex.setProperty(Constants.RELATIONSHIPTYPE_END2_KEY, AtlasType.toJson(relationshipDef.getEndDef2()));
// Update RelationshipCategory // Update RelationshipCategory
vertex.setProperty(Constants.RELATIONSHIPTYPE_CATEGORY_KEY, relationshipDef.getRelationshipCategory().name()); vertex.setProperty(Constants.RELATIONSHIPTYPE_CATEGORY_KEY, relationshipDef.getRelationshipCategory().name());
vertex.setProperty(Constants.RELATIONSHIPTYPE_TAG_PROPAGATION_KEY, relationshipDef.getPropagateTags().name()); vertex.setProperty(Constants.RELATIONSHIPTYPE_TAG_PROPAGATION_KEY, relationshipDef.getPropagateTags().name());
...@@ -358,8 +358,8 @@ public class AtlasRelationshipDefStoreV1 extends AtlasAbstractDefStoreV1 impleme ...@@ -358,8 +358,8 @@ public class AtlasRelationshipDefStoreV1 extends AtlasAbstractDefStoreV1 impleme
private void updateVertexPreUpdate(AtlasRelationshipDef relationshipDef, AtlasRelationshipType relationshipType, private void updateVertexPreUpdate(AtlasRelationshipDef relationshipDef, AtlasRelationshipType relationshipType,
AtlasVertex vertex) throws AtlasBaseException { AtlasVertex vertex) throws AtlasBaseException {
AtlasStructDefStoreV1.updateVertexPreUpdate(relationshipDef, relationshipType, vertex, typeDefStore); AtlasStructDefStoreV1.updateVertexPreUpdate(relationshipDef, relationshipType, vertex, typeDefStore);
vertex.setProperty(Constants.RELATIONSHIPTYPE_ENDPOINT1_KEY, AtlasType.toJson(relationshipDef.getEndPointDef1())); vertex.setProperty(Constants.RELATIONSHIPTYPE_END1_KEY, AtlasType.toJson(relationshipDef.getEndDef1()));
vertex.setProperty(Constants.RELATIONSHIPTYPE_ENDPOINT2_KEY, AtlasType.toJson(relationshipDef.getEndPointDef2())); vertex.setProperty(Constants.RELATIONSHIPTYPE_END2_KEY, AtlasType.toJson(relationshipDef.getEndDef2()));
// Update RelationshipCategory // Update RelationshipCategory
vertex.setProperty(Constants.RELATIONSHIPTYPE_CATEGORY_KEY, relationshipDef.getRelationshipCategory().name()); vertex.setProperty(Constants.RELATIONSHIPTYPE_CATEGORY_KEY, relationshipDef.getRelationshipCategory().name());
vertex.setProperty(Constants.RELATIONSHIPTYPE_TAG_PROPAGATION_KEY, relationshipDef.getPropagateTags().name()); vertex.setProperty(Constants.RELATIONSHIPTYPE_TAG_PROPAGATION_KEY, relationshipDef.getPropagateTags().name());
...@@ -372,14 +372,14 @@ public class AtlasRelationshipDefStoreV1 extends AtlasAbstractDefStoreV1 impleme ...@@ -372,14 +372,14 @@ public class AtlasRelationshipDefStoreV1 extends AtlasAbstractDefStoreV1 impleme
String name = vertex.getProperty(Constants.TYPENAME_PROPERTY_KEY, String.class); String name = vertex.getProperty(Constants.TYPENAME_PROPERTY_KEY, String.class);
String description = vertex.getProperty(Constants.TYPEDESCRIPTION_PROPERTY_KEY, String.class); String description = vertex.getProperty(Constants.TYPEDESCRIPTION_PROPERTY_KEY, String.class);
String version = vertex.getProperty(Constants.TYPEVERSION_PROPERTY_KEY, String.class); String version = vertex.getProperty(Constants.TYPEVERSION_PROPERTY_KEY, String.class);
String endPoint1Str = vertex.getProperty(Constants.RELATIONSHIPTYPE_ENDPOINT1_KEY, String.class); String end1Str = vertex.getProperty(Constants.RELATIONSHIPTYPE_END1_KEY, String.class);
String endPoint2Str = vertex.getProperty(Constants.RELATIONSHIPTYPE_ENDPOINT2_KEY, String.class); String end2Str = vertex.getProperty(Constants.RELATIONSHIPTYPE_END2_KEY, String.class);
String relationStr = vertex.getProperty(Constants.RELATIONSHIPTYPE_CATEGORY_KEY, String.class); String relationStr = vertex.getProperty(Constants.RELATIONSHIPTYPE_CATEGORY_KEY, String.class);
String propagateStr = vertex.getProperty(Constants.RELATIONSHIPTYPE_TAG_PROPAGATION_KEY, String.class); String propagateStr = vertex.getProperty(Constants.RELATIONSHIPTYPE_TAG_PROPAGATION_KEY, String.class);
// set the endpoints // set the ends
AtlasRelationshipEndPointDef endPointDef1 = AtlasType.fromJson(endPoint1Str, AtlasRelationshipEndPointDef.class); AtlasRelationshipEndDef endDef1 = AtlasType.fromJson(end1Str, AtlasRelationshipEndDef.class);
AtlasRelationshipEndPointDef endPointDef2 = AtlasType.fromJson(endPoint2Str, AtlasRelationshipEndPointDef.class); AtlasRelationshipEndDef endDef2 = AtlasType.fromJson(end2Str, AtlasRelationshipEndDef.class);
// set the relationship Category // set the relationship Category
RelationshipCategory relationshipCategory = null; RelationshipCategory relationshipCategory = null;
...@@ -397,7 +397,7 @@ public class AtlasRelationshipDefStoreV1 extends AtlasAbstractDefStoreV1 impleme ...@@ -397,7 +397,7 @@ public class AtlasRelationshipDefStoreV1 extends AtlasAbstractDefStoreV1 impleme
} }
} }
ret = new AtlasRelationshipDef(name, description, version, relationshipCategory, propagateTags, endPointDef1, endPointDef2); ret = new AtlasRelationshipDef(name, description, version, relationshipCategory, propagateTags, endDef1, endDef2);
// add in the attributes // add in the attributes
AtlasStructDefStoreV1.toStructDef(vertex, ret, typeDefStore); AtlasStructDefStoreV1.toStructDef(vertex, ret, typeDefStore);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment