attribInfo.put("isComposite", attribute.isOwnedRef()); attribInfo.put("reverseAttributeName", attribute.getInverseRefAttributeName()); attribInfo.put("defaultValue", attributeDef.getDefaultValue()); attribInfo.put("description", attributeDef.getDescription());
attribInfo.put("isComposite", attribute.isOwnedRef()); attribInfo.put("reverseAttributeName", attribute.getInverseRefAttributeName()); attribInfo.put("defaultValue", attributeDef.getDefaultValue()); attribInfo.put("description", attributeDef.getDescription());
private Object createDefaultValue(AtlasAttributeDef attributeDef) { Object ret = null; if (attributeDef != null) { AtlasAttribute attribute = allAttributes.get(attributeDef.getName()); if (attribute != null) { AtlasType dataType = attribute.getAttributeType(); ret = dataType.createDefaultValue(attributeDef.getDefaultValue()); } } return ret; }
ret.setIsComposite(attribute.isOwnedRef()); ret.setReverseAttributeName(attribute.getInverseRefAttributeName()); ret.setDefaultValue(attributeDef.getDefaultValue()); ret.setDescription(attributeDef.getDescription());
private void mapAttribute(AtlasAttribute attribute, Object attrValue, AtlasVertex vertex, EntityOperation op, EntityMutationContext context) throws AtlasBaseException { if (attrValue == null) { AtlasAttributeDef attributeDef = attribute.getAttributeDef(); AtlasType attrType = attribute.getAttributeType(); if (attrType.getTypeCategory() == TypeCategory.PRIMITIVE) { if (attributeDef.getDefaultValue() != null) { attrValue = attrType.createDefaultValue(attributeDef.getDefaultValue()); } else { if (attribute.getAttributeDef().getIsOptional()) { attrValue = attrType.createOptionalDefaultValue(); } else { attrValue = attrType.createDefaultValue(); } } } } AttributeMutationContext ctx = new AttributeMutationContext(op, vertex, attribute, attrValue); mapToVertexByTypeCategory(ctx, context); }
private void mapAttribute(AtlasAttribute attribute, Object attrValue, AtlasVertex vertex, EntityOperation op, EntityMutationContext context) throws AtlasBaseException { if (attrValue == null) { AtlasAttributeDef attributeDef = attribute.getAttributeDef(); AtlasType attrType = attribute.getAttributeType(); if (attrType.getTypeCategory() == TypeCategory.PRIMITIVE) { if (attributeDef.getDefaultValue() != null) { attrValue = attrType.createDefaultValue(attributeDef.getDefaultValue()); } else { if (attribute.getAttributeDef().getIsOptional()) { attrValue = attrType.createOptionalDefaultValue(); } else { attrValue = attrType.createDefaultValue(); } } } } AttributeMutationContext ctx = new AttributeMutationContext(op, vertex, attribute, attrValue); mapToVertexByTypeCategory(ctx, context); }
public AtlasAttributeDef(AtlasAttributeDef other) { if (other != null) { setName(other.getName()); setTypeName(other.getTypeName()); setIsOptional(other.getIsOptional()); setCardinality(other.getCardinality()); setValuesMinCount(other.getValuesMinCount()); setValuesMaxCount(other.getValuesMaxCount()); setIsUnique(other.getIsUnique()); setIsIndexable(other.getIsIndexable()); setIncludeInNotification(other.getIncludeInNotification()); setDefaultValue(other.getDefaultValue()); setConstraints(other.getConstraints()); setDescription((other.getDescription())); } }
public AtlasAttributeDef(AtlasAttributeDef other) { if (other != null) { setName(other.getName()); setTypeName(other.getTypeName()); setIsOptional(other.getIsOptional()); setCardinality(other.getCardinality()); setValuesMinCount(other.getValuesMinCount()); setValuesMaxCount(other.getValuesMaxCount()); setIsUnique(other.getIsUnique()); setIsIndexable(other.getIsIndexable()); setDefaultValue(other.getDefaultValue()); setConstraints(other.getConstraints()); } }
public static AttributeDefinition toAttributeDefinition(AtlasAttribute attribute) { final AtlasAttributeDef attrDef = attribute.getAttributeDef(); AttributeDefinition ret = new AttributeDefinition(); ret.setName(attrDef.getName()); ret.setDataTypeName(attrDef.getTypeName()); ret.setMultiplicity(getMultiplicity(attrDef)); ret.setIsComposite(attribute.isOwnedRef()); ret.setIsUnique(attrDef.getIsUnique()); ret.setIsIndexable(attrDef.getIsIndexable()); ret.setReverseAttributeName(attribute.getInverseRefAttributeName()); ret.setDescription(attrDef.getDescription()); ret.setDefaultValue(attrDef.getDefaultValue()); return ret; } }
public static AttributeDefinition toAttributeDefinition(AtlasAttribute attribute) { final AtlasAttributeDef attrDef = attribute.getAttributeDef(); AttributeDefinition ret = new AttributeDefinition(); ret.setName(attrDef.getName()); ret.setDataTypeName(attrDef.getTypeName()); ret.setMultiplicity(AtlasTypeUtil.getMultiplicity(attrDef)); ret.setIsComposite(attribute.isOwnedRef()); ret.setIsUnique(attrDef.getIsUnique()); ret.setIsIndexable(attrDef.getIsIndexable()); ret.setReverseAttributeName(attribute.getInverseRefAttributeName()); ret.setDescription(attrDef.getDescription()); ret.setDefaultValue(attrDef.getDefaultValue()); return ret; } }
private Object createDefaultValue(AtlasAttributeDef attributeDef) { Object ret = null; if (attributeDef != null) { AtlasAttribute attribute = allAttributes.get(attributeDef.getName()); if (attribute != null) { AtlasType dataType = attribute.getAttributeType(); ret = dataType.createDefaultValue(attributeDef.getDefaultValue()); } } return ret; }