Class SchemaAttributeBuilder


public class SchemaAttributeBuilder extends ReferenceableBuilder
SchemaAttributeBuilder creates instance properties for a schema attribute.
  • Constructor Details

    • SchemaAttributeBuilder

      public SchemaAttributeBuilder(String qualifiedName, String displayName, String description, OMRSRepositoryHelper repositoryHelper, String serviceName, String serverName)
      Template constructor
      Parameters:
      qualifiedName - unique name
      displayName - new value for the display name
      description - description of the schema attribute
      repositoryHelper - helper methods
      serviceName - name of this OMAS
      serverName - name of local server
    • SchemaAttributeBuilder

      public SchemaAttributeBuilder(OMRSRepositoryHelper repositoryHelper, String serviceName, String serverName)
      Template constructor
      Parameters:
      repositoryHelper - helper methods
      serviceName - name of this OMAS
      serverName - name of local server
    • SchemaAttributeBuilder

      public SchemaAttributeBuilder(String qualifiedName, String displayName, String description, int elementPosition, int minCardinality, int maxCardinality, boolean isDeprecated, String defaultValueOverride, boolean allowsDuplicateValues, boolean orderedValues, int sortOrder, int minimumLength, int length, int precision, boolean isNullable, String nativeJavaClass, List<String> aliases, Map<String,String> additionalProperties, String typeId, String typeName, Map<String,Object> extendedProperties, OMRSRepositoryHelper repositoryHelper, String serviceName, String serverName)
      Constructor supporting all properties for a schema attribute entity.
      Parameters:
      qualifiedName - unique name
      displayName - new value for the display name.
      description - new value for the description.
      elementPosition - position of the attribute in the parent schemaType.
      minCardinality - is the attribute optional?
      maxCardinality - does the attribute repeat?
      isDeprecated - is this element deprecated?
      defaultValueOverride - override for the Type's default value.
      allowsDuplicateValues - unique values ?
      orderedValues - ordered values ?
      sortOrder - sort order if ordered
      minimumLength - minimum length of data in field
      length - size of data field
      precision - Number of digits after the decimal point.
      isNullable - can the value be null?
      nativeJavaClass - name of implementation class for Java
      aliases - aliases for the field
      additionalProperties - additional properties
      typeName - name of the type for this schema element
      typeId - unique identifier of the type for this schema element
      extendedProperties - properties from the subtype.
      repositoryHelper - helper methods
      serviceName - name of this OMAS
      serverName - name of local server
  • Method Details

    • setSchemaType

      public void setSchemaType(String userId, SchemaTypeBuilder schemaTypeBuilder, String methodName) throws InvalidParameterException
      The schema type can be stored in the TypeEmbeddedAttribute classification for the schema attribute entity. Depending on the type of schema, the schema type may require additional entities and relationships. The schemaTypeBuilder has this knowledge which is why the schemaTypeBuilder is saved. This method overrides any previously defined TypeEmbeddedAttribute classification for this entity.
      Parameters:
      userId - calling user
      schemaTypeBuilder - builder containing the properties of the schema type
      methodName - calling method
      Throws:
      InvalidParameterException - TypeEmbeddedAttribute is not supported in the local repository, or any repository connected by an open metadata repository cohort
    • setAnchors

      public void setAnchors(String userId, String anchorGUID, String anchorTypeName, String anchorDomainName, String anchorScopeGUID, String methodName) throws PropertyServerException
      Set up the "Anchors" classification for this entity. This is used when a new entity is being created, and it is known to be connected to a specific anchor.
      Overrides:
      setAnchors in class OpenMetadataAPIGenericBuilder
      Parameters:
      userId - calling user
      anchorGUID - unique identifier of the anchor entity that this entity is linked to directly or indirectly
      anchorTypeName - unique name of the anchor entity's type
      anchorDomainName - unique name of the anchor entity's domain
      anchorScopeGUID - unique identifier of the anchor's scope
      methodName - calling method
      Throws:
      PropertyServerException - a null anchors GUID has been supplied
    • getSchemaTypeBuilder

      public SchemaTypeBuilder getSchemaTypeBuilder()
      Return the schema type builder to the handler to add any extra elements.
      Returns:
      schema type builder object
    • getCalculatedValueProperties

      public InstanceProperties getCalculatedValueProperties(String formula, String methodName)
      Return the schema type properties in an InstanceProperties object.
      Parameters:
      formula - details of how this value is calculated
      methodName - name of the calling method
      Returns:
      InstanceProperties object
    • getInstanceProperties

      public InstanceProperties getInstanceProperties(String methodName) throws InvalidParameterException
      Return the supplied bean properties in an InstanceProperties object.
      Overrides:
      getInstanceProperties in class ReferenceableBuilder
      Parameters:
      methodName - name of the calling method
      Returns:
      InstanceProperties object
      Throws:
      InvalidParameterException - there is a problem with the properties