Class DataModel

  • All Implemented Interfaces:
    IAsset, IDataModel, java.io.Serializable

    public class DataModel
    extends AbstractAsset
    implements IDataModel
    Represents a DataModel and it's metadata description. DataModels reside within a schema and contains properties and relationships to other datamodels.
    See Also:
    Serialized Form
    • Constructor Detail

      • DataModel

        public DataModel()
      • DataModel

        public DataModel​(java.lang.String name,
                         java.lang.String schemaName)
      • DataModel

        public DataModel​(java.lang.String name,
                         java.lang.String schemaName,
                         java.util.List<IProperty> properties)
      • DataModel

        public DataModel​(java.lang.String name,
                         java.lang.String schemaName,
                         java.util.List<IProperty> properties,
                         java.util.List<Relationship> relationships)
    • Method Detail

      • getId

        public java.lang.String getId()
        Description copied from class: AbstractAsset
        Gets the identifier of this Asset
        Specified by:
        getId in interface IAsset
        Overrides:
        getId in class AbstractAsset
        Returns:
        the identifier of this Asset
      • setId

        public void setId​(java.lang.String id)
        Overrides:
        setId in class AbstractAsset
      • getRequired

        public java.lang.String[] getRequired()
      • setRequired

        public void setRequired​(java.lang.String[] required)
      • getSchemaName

        public java.lang.String getSchemaName()
        Gets the name of schema in which this datamodel resides in.
        Specified by:
        getSchemaName in interface IDataModel
        Returns:
        the schema name in which this datamodel resides in.
      • setSchemaName

        public void setSchemaName​(java.lang.String schemaName)
      • getProperties

        public java.util.List<IProperty> getProperties()
        Gets the properties of this datamodel.
        Specified by:
        getProperties in interface IDataModel
        Returns:
        the properties of this datamodel.
      • setProperties

        public void setProperties​(java.util.List<? extends IProperty> properties)
        Sets the properties of this datamodel.
        Specified by:
        setProperties in interface IDataModel
        Parameters:
        properties - the properties of this datamodel.
      • addProperties

        public void addProperties​(java.util.List<IProperty> addProperties)
      • getRelationships

        public java.util.List<Relationship> getRelationships()
      • getRelationships

        public java.util.List<Relationship> getRelationships​(IDataModel otherDataModel)
        Gets relationships between this dataModel and another dataModel.
        Specified by:
        getRelationships in interface IDataModel
        Parameters:
        otherDataModel - another datamodel for which to find relationships to and from.
        Returns:
        an array of relationsips between this and the other datamodel.
      • isRootEntity

        public boolean isRootEntity()
        Description copied from interface: IDataModel
        RootEntity is true if it is either an argument or return type of an operation
        Specified by:
        isRootEntity in interface IDataModel
        Returns:
      • setRootEntity

        public void setRootEntity​(boolean value)
        Specified by:
        setRootEntity in interface IDataModel
      • setRelationships

        public void setRelationships​(java.util.List<Relationship> relationships)
      • getPropertyNames

        public java.lang.String[] getPropertyNames()
        Gets the names of this datamodel's properties.
        Returns:
        an array of property names.
      • getPropertyByName

        public IProperty getPropertyByName​(java.lang.String propertyName)
        Convenience method for retrieving a property by it's name.
        Parameters:
        propertyName - the name of the property to retrieve
        Returns:
        the property with the given name. Returns null if no such property is found.
      • getPrimaryKeys

        public IProperty[] getPrimaryKeys()
        Gets the properties of this datamodel that are known to be primary keys. See IProperty.isPrimaryKey().
        Returns:
        an array of properties that are known to be primary keys.
      • addProperty

        public void addProperty​(IProperty property)
        Add property to data model
        Parameters:
        property -
      • addAssociation

        public void addAssociation​(PropertyType associationType,
                                   java.lang.String name,
                                   IDataModel dataModel)
                            throws DermisException
        Add the associated datamodel
        Parameters:
        associationType - association type either COLLECTION or OBJECT
        name - name of the property
        dataModel - associated data model
        Throws:
        DermisException
      • setBinaryEntity

        public void setBinaryEntity​(boolean binaryEntity)
        Specified by:
        setBinaryEntity in interface IDataModel
      • isGenericOperationAllowed

        public boolean isGenericOperationAllowed()
        Flag represents whether this entity can be bind with generic operations
        Specified by:
        isGenericOperationAllowed in interface IDataModel
        Returns:
        - Return true if generic operation are allowed.
      • setGenericOperationAllowed

        public void setGenericOperationAllowed​(boolean genericOperationAllowed)
        Set true if generic operations are allowed in this dataModel.
        Parameters:
        genericOperationAllowed -