Package com.sas.metadata.remote.entities

# Class MdOMAEntityUtility

java.lang.Object
com.sas.metadata.remote.entities.MdOMAEntityUtility

public class MdOMAEntityUtility extends Object
This class is used for the persistence/serialization of entities to OMR.

## Usage

enclosing_type usage is decribed as:

## Behavior

## Extending

## Dependencies

Since:
  9.1
See Also:
  - `com.sas.metadata.remote.entities`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `AttributeDescriptorGetTemplate`
  This is to get all the attribute descriptor related objects from OMR, given an attribute descriptor Property object.
  `static final String`
  `AttributeGroupGetTemplate`
  This is to get all the attribute group related objects from OMR, given an attribute group PropertyGroup object.
  `static final String`
  `AttributeTypeGetTemplate`
  This is to get all the attribute type related objects from OMR, given an attribute type PropertyType object.
  `static final String`
  `EntityAllGetTemplate`
  This template is used to get all the entity related objects, given the entity property object.
  `static final String`
  `EntityObjectGetTemplate`
  This is to get all the entity directly related objects from OMR, given an entity Property object.
  `static final String`
  `EntityStoreAllDeleteTemplate`
  `static final String`
  `EntityStoreAllDeleteTemplate2`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MdOMAEntityUtility()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `clearPropertyTypesForObjectRepository(Root sourceObject)`
  `static void`
  `copyEntityToNewObject(Root sourceObject, Root targetObject)`
  This method takes a source metadata object and creates the metadata for an entity from that object for a target object.
  `static void`
  `deleteObjectFromStore(Property entityProp, String template)`
  Removes the entity from usage and delete it from OMR at next updateMetadataAll() call.
  `static Property`
  `getEntityPropertyForOMRObject(Root omrObject)`
  Given an OMR Metadata object, retrieve the Property object that represents the Entity associated with the given OMR object.
  `static PropertyType`
  `getGenericPropertyType(Root sourceObject)`
  Get the generic String PropertyType used for all Properties who have string values.
  `static List`
  `getPropertyTypesForObjectRepository(Root sourceObject)`
  Get the PropertyType objects for the repository `sourceObject` is in.
  `static List`
  `getPropertyTypesForObjectRepositoryIDList(Root inObject)`
  Get the PropertyType object ids for the repository that `inobject` is in.
  `static void`
  `populateEntityAttributeDescriptorfromOMRProperty(com.sas.entities.AttributeDescriptorInterface attrDesc, Property propObject)`
  Populate an Entity AttributeDescriptor from an OMR Property
  `protected static void`
  `populateEntityAttributeDescriptorfromOMRProperty(com.sas.entities.AttributeDescriptorInterface attrDesc, Property propObject, boolean goToServer)`
  Populate an Entity AttributeDescriptor from an OMR Property
  `static void`
  `populateEntityAttributeTypeFromOMRPropertyType(com.sas.entities.AttributeTypeInterface attrType, PropertyType propType)`
  Populate an Entity AttributeType from an OMR PropertyType
  `protected static void`
  `populateEntityAttributeTypeFromOMRPropertyType(com.sas.entities.AttributeTypeInterface attrType, PropertyType propType, boolean goToServer)`
  Populate an Entity AttributeType from an OMR PropertyType
  `static void`
  `populateEntityFromOMRObject(com.sas.entities.RemoteEntityInterface entity, Root omrObject)`
  Take an existing entity object and populate it from metadata object.
  `static void`
  `populateEntityFromOMRProperty(com.sas.entities.RemoteEntityInterface entity, Property propObject)`
  populate an entity from the omr Property object that represents that entity.
  `static void`
  `populateEntityGroupfromOMRGroup(com.sas.entities.AttributeGroupInterface group, PropertyGroup omrGroup)`
  Populate an Entity AttributeGroup from an OMR PropertyGroup
  `protected static void`
  `populateEntityGroupfromOMRGroup(com.sas.entities.AttributeGroupInterface group, PropertyGroup omrGroup, boolean goToServer)`
  Populate an Entity AttributeGroup from an OMR PropertyGroup
  `static void`
  `populateOMRObjectFromEntity(Root omrObject, com.sas.entities.RemoteEntityInterface entity)`
  Take an metadata object and populate it with the entity information.
  `static void`
  `populateOMRPropertyFromAttributeDescriptor(Property propAttr, com.sas.entities.AttributeDescriptorInterface attrDesc)`
  Populate an OMR Property from and Entity Attribute Descriptor
  `static void`
  `populateOMRPropertyFromEntity(Property entityProp, com.sas.entities.RemoteEntityInterface entity)`
  Take an metadata object and populate it with the entity information.
  `static void`
  `populateOMRPropertyGroupFromAttributeGroup(PropertyGroup propGroup, com.sas.entities.AttributeGroupInterface attrGroup)`
  Populate an OMR PropertyGroup from an Entity Attribute Group.
  `static void`
  `populateOMRPropertyTypeFromAttributeType(PropertyType propType, com.sas.entities.AttributeTypeInterface attrType)`
  Populate an OMR PropertyType from an Entity AttributeType
  `static void`
  `removeEntityFromOMR(Root omrObject)`
  Given an OMR Metadata object, remove the Property object(s) that represents the Entity associated with the given OMR object.
  `static void`
  `removeEntityPropertyObjectFromOMR(Property omrProperty)`
  Remoe an entity property object and all connected objects from OMR.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### EntityAllGetTemplate

    public static final String EntityAllGetTemplate
    This template is used to get all the entity related objects, given the entity property object.
    See Also:
      - Constant Field Values

  - ### EntityStoreAllDeleteTemplate

    public static final String EntityStoreAllDeleteTemplate
    See Also:
      - Constant Field Values

  - ### EntityStoreAllDeleteTemplate2

    public static final String EntityStoreAllDeleteTemplate2
    See Also:
      - Constant Field Values

  - ### AttributeDescriptorGetTemplate

    public static final String AttributeDescriptorGetTemplate
    This is to get all the attribute descriptor related objects from OMR, given an attribute descriptor Property object.
    See Also:
      - Constant Field Values

  - ### AttributeGroupGetTemplate

    public static final String AttributeGroupGetTemplate
    This is to get all the attribute group related objects from OMR, given an attribute group PropertyGroup object.
    See Also:
      - Constant Field Values

  - ### AttributeTypeGetTemplate

    public static final String AttributeTypeGetTemplate
    This is to get all the attribute type related objects from OMR, given an attribute type PropertyType object.
    See Also:
      - Constant Field Values

  - ### EntityObjectGetTemplate

    public static final String EntityObjectGetTemplate
    This is to get all the entity directly related objects from OMR, given an entity Property object.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### MdOMAEntityUtility

    public MdOMAEntityUtility()

- ## Method Details

  - ### populateEntityFromOMRObject

    public static void populateEntityFromOMRObject(com.sas.entities.RemoteEntityInterface entity, Root omrObject) throws MdException, RemoteException
    Take an existing entity object and populate it from metadata object.
    Parameters:
      `entity` - The entity object to populate
      `omrObject` - the object to get the entity information from.
    Throws:
      `MdException` - if any errors retrieveing or setting the data from OMR
      `RemoteException`

  - ### populateEntityFromOMRProperty

    public static void populateEntityFromOMRProperty(com.sas.entities.RemoteEntityInterface entity, Property propObject) throws MdException, RemoteException
    populate an entity from the omr Property object that represents that entity.
    Parameters:
      `entity` -
      `propObject` -
    Throws:
      `MdException`
      `RemoteException`

  - ### populateEntityGroupfromOMRGroup

    public static void populateEntityGroupfromOMRGroup(com.sas.entities.AttributeGroupInterface group, PropertyGroup omrGroup) throws MdException, RemoteException
    Populate an Entity AttributeGroup from an OMR PropertyGroup
    Parameters:
      `group` -
      `omrGroup` -
    Throws:
      `MdException`
      `RemoteException`

  - ### populateEntityGroupfromOMRGroup

    protected static void populateEntityGroupfromOMRGroup(com.sas.entities.AttributeGroupInterface group, PropertyGroup omrGroup, boolean goToServer) throws MdException, RemoteException
    Populate an Entity AttributeGroup from an OMR PropertyGroup
    Parameters:
      `group` -
      `omrGroup` -
      `goToServer` - Determines whether or not to go to the server to get the PropertyGroup object. Default is `true`.
    Throws:
      `MdException`
      `RemoteException`

  - ### populateEntityAttributeDescriptorfromOMRProperty

    public static void populateEntityAttributeDescriptorfromOMRProperty(com.sas.entities.AttributeDescriptorInterface attrDesc, Property propObject) throws MdException, RemoteException
    Populate an Entity AttributeDescriptor from an OMR Property
    Parameters:
      `attrDesc` -
      `propObject` -
    Throws:
      `MdException`
      `RemoteException`

  - ### populateEntityAttributeDescriptorfromOMRProperty

    protected static void populateEntityAttributeDescriptorfromOMRProperty(com.sas.entities.AttributeDescriptorInterface attrDesc, Property propObject, boolean goToServer) throws MdException, RemoteException
    Populate an Entity AttributeDescriptor from an OMR Property
    Parameters:
      `attrDesc` -
      `propObject` -
      `goToServer` - Determines whether or not to go to the server to get the Property object. Default is `true`.
    Throws:
      `MdException`
      `RemoteException`

  - ### populateEntityAttributeTypeFromOMRPropertyType

    public static void populateEntityAttributeTypeFromOMRPropertyType(com.sas.entities.AttributeTypeInterface attrType, PropertyType propType) throws MdException, RemoteException
    Populate an Entity AttributeType from an OMR PropertyType
    Parameters:
      `attrType` -
      `propType` -
    Throws:
      `MdException`
      `RemoteException`

  - ### populateEntityAttributeTypeFromOMRPropertyType

    protected static void populateEntityAttributeTypeFromOMRPropertyType(com.sas.entities.AttributeTypeInterface attrType, PropertyType propType, boolean goToServer) throws MdException, RemoteException
    Populate an Entity AttributeType from an OMR PropertyType
    Parameters:
      `attrType` -
      `propType` -
      `goToServer` - Determines whether or not to go to the server to get the PropertyType object. Default is `true`.
    Throws:
      `MdException`
      `RemoteException`

  - ### populateOMRPropertyFromEntity

    public static void populateOMRPropertyFromEntity(Property entityProp, com.sas.entities.RemoteEntityInterface entity) throws MdException, RemoteException
    Take an metadata object and populate it with the entity information.
    Parameters:
      `entity` - The entity object get data from
      `omrObject` - the object populate with the entity's information
    Throws:
      `MdException` - if any errors retrieveing or setting the data from OR
      `RemoteException`

  - ### populateOMRPropertyGroupFromAttributeGroup

    public static void populateOMRPropertyGroupFromAttributeGroup(PropertyGroup propGroup, com.sas.entities.AttributeGroupInterface attrGroup) throws MdException, RemoteException
    Populate an OMR PropertyGroup from an Entity Attribute Group.
    Parameters:
      `propGroup` -
      `attrGroup` -
    Throws:
      `MdException`
      `RemoteException`

  - ### populateOMRPropertyFromAttributeDescriptor

    public static void populateOMRPropertyFromAttributeDescriptor(Property propAttr, com.sas.entities.AttributeDescriptorInterface attrDesc) throws MdException, RemoteException
    Populate an OMR Property from and Entity Attribute Descriptor
    Parameters:
      `propAttr` -
      `attrDesc` -
    Throws:
      `MdException`
      `RemoteException`

  - ### populateOMRPropertyTypeFromAttributeType

    public static void populateOMRPropertyTypeFromAttributeType(PropertyType propType, com.sas.entities.AttributeTypeInterface attrType) throws MdException, RemoteException
    Populate an OMR PropertyType from an Entity AttributeType
    Parameters:
      `propType` -
      `attrType` -
    Throws:
      `MdException`
      `RemoteException`

  - ### populateOMRObjectFromEntity

    public static void populateOMRObjectFromEntity(Root omrObject, com.sas.entities.RemoteEntityInterface entity) throws MdException, RemoteException
    Take an metadata object and populate it with the entity information.
    Parameters:
      `omrObject` - the object populate with the entity's information
      `entity` - The entity object get data from
    Throws:
      `MdException` - if any errors retrieveing or setting the data from OMR
      `RemoteException`

  - ### getEntityPropertyForOMRObject

    public static Property getEntityPropertyForOMRObject(Root omrObject) throws MdException, RemoteException
    Given an OMR Metadata object, retrieve the Property object that represents the Entity associated with the given OMR object.
    Parameters:
      `omrObject` - the object to get the entity information from, null if not found.
    Throws:
      `MdException` - if any errors retrieveing or setting the data from OMR
      `RemoteException`

  - ### removeEntityFromOMR

    public static void removeEntityFromOMR(Root omrObject) throws MdException, RemoteException
    Given an OMR Metadata object, remove the Property object(s) that represents the Entity associated with the given OMR object.
    Parameters:
      `omrObject` - the object to get the entity information from.
    Throws:
      `MdException` - if any errors retrieveing or removing the data from OMR
      `RemoteException`

  - ### removeEntityPropertyObjectFromOMR

    public static void removeEntityPropertyObjectFromOMR(Property omrProperty) throws MdException, RemoteException
    Remoe an entity property object and all connected objects from OMR.
    Parameters:
      `omrProperty` -
    Throws:
      `MdException`
      `RemoteException`

  - ### deleteObjectFromStore

    public static void deleteObjectFromStore(Property entityProp, String template) throws MdException, RemoteException
    Removes the entity from usage and delete it from OMR at next updateMetadataAll() call.
    Parameters:
      `entityProp` - The property object that represents the entity.
    Throws:
      `MdException`
      `RemoteException`

  - ### copyEntityToNewObject

    public static void copyEntityToNewObject(Root sourceObject, Root targetObject) throws MdException, RemoteException
    This method takes a source metadata object and creates the metadata for an entity from that object for a target object.
    Parameters:
      `sourceObject` - Object to get entity information from
      `targetObject` - object to populate with entity information.
    Throws:
      `MdException`
      `RemoteException`

  - ### clearPropertyTypesForObjectRepository

    public static void clearPropertyTypesForObjectRepository(Root sourceObject) throws RemoteException
    Throws:
      `RemoteException`

  - ### getPropertyTypesForObjectRepository

    public static List getPropertyTypesForObjectRepository(Root sourceObject) throws MdException, RemoteException
    Get the PropertyType objects for the repository `sourceObject` is in.
    Parameters:
      `sourceObject` -
    Returns:
      List
    Throws:
      `MdException`
      `RemoteException`

  - ### getPropertyTypesForObjectRepositoryIDList

    public static List getPropertyTypesForObjectRepositoryIDList(Root inObject) throws MdException, RemoteException
    Get the PropertyType object ids for the repository that `inobject` is in.
    Parameters:
      `inObject` -
    Returns:
      List
    Throws:
      `MdException`
      `RemoteException`

  - ### getGenericPropertyType

    public static PropertyType getGenericPropertyType(Root sourceObject) throws MdException, RemoteException
    Get the generic String PropertyType used for all Properties who have string values.
    Parameters:
      `sourceObject` -
    Returns:
      PropertyType
    Throws:
      `MdException`
      `RemoteException`