Package com.adobe.aem.dermis.model
Class DataModel
- java.lang.Object
-
- com.adobe.aem.dermis.model.AbstractAsset
-
- com.adobe.aem.dermis.model.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 Summary
Constructors Constructor Description DataModel()
DataModel(java.lang.String name, java.lang.String schemaName)
DataModel(java.lang.String name, java.lang.String schemaName, java.util.List<IProperty> properties)
DataModel(java.lang.String name, java.lang.String schemaName, java.util.List<IProperty> properties, java.util.List<Relationship> relationships)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAssociation(PropertyType associationType, java.lang.String name, IDataModel dataModel)
Add the associated datamodelvoid
addProperties(java.util.List<IProperty> addProperties)
void
addProperty(IProperty property)
Add property to data modeljava.lang.String
getId()
Gets the identifier of this AssetIProperty[]
getPrimaryKeys()
Gets the properties of this datamodel that are known to be primary keys.java.util.List<IProperty>
getProperties()
Gets the properties of this datamodel.IProperty
getPropertyByName(java.lang.String propertyName)
Convenience method for retrieving a property by it's name.java.lang.String[]
getPropertyNames()
Gets the names of this datamodel's properties.java.util.List<Relationship>
getRelationships()
java.util.List<Relationship>
getRelationships(IDataModel otherDataModel)
Gets relationships between this dataModel and another dataModel.java.lang.String[]
getRequired()
java.lang.String
getSchemaName()
Gets the name of schema in which this datamodel resides in.boolean
isBinaryEntity()
boolean
isDefaultBinaryEntity()
boolean
isGenericOperationAllowed()
Flag represents whether this entity can be bind with generic operationsboolean
isRootEntity()
RootEntity is true if it is either an argument or return type of an operationvoid
setBinaryEntity(boolean binaryEntity)
void
setDefaultBinaryEntity(boolean defaultBinaryEntity)
void
setGenericOperationAllowed(boolean genericOperationAllowed)
Set true if generic operations are allowed in this dataModel.void
setId(java.lang.String id)
void
setProperties(java.util.List<? extends IProperty> properties)
Sets the properties of this datamodel.void
setRelationships(java.util.List<Relationship> relationships)
void
setRequired(java.lang.String[] required)
void
setRootEntity(boolean value)
void
setSchemaName(java.lang.String schemaName)
-
Methods inherited from class com.adobe.aem.dermis.model.AbstractAsset
getDescription, getName, getTitle, setDescription, setName, setTitle
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adobe.aem.dermis.model.IAsset
getDescription, getName, getTitle
-
-
-
-
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 interfaceIAsset
- Overrides:
getId
in classAbstractAsset
- Returns:
- the identifier of this Asset
-
setId
public void setId(java.lang.String id)
- Overrides:
setId
in classAbstractAsset
-
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 interfaceIDataModel
- 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 interfaceIDataModel
- 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 interfaceIDataModel
- 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 interfaceIDataModel
- 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 interfaceIDataModel
- Returns:
-
setRootEntity
public void setRootEntity(boolean value)
- Specified by:
setRootEntity
in interfaceIDataModel
-
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. SeeIProperty.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 OBJECTname
- name of the propertydataModel
- associated data model- Throws:
DermisException
-
isBinaryEntity
public boolean isBinaryEntity()
- Specified by:
isBinaryEntity
in interfaceIDataModel
-
setBinaryEntity
public void setBinaryEntity(boolean binaryEntity)
- Specified by:
setBinaryEntity
in interfaceIDataModel
-
isDefaultBinaryEntity
public boolean isDefaultBinaryEntity()
- Specified by:
isDefaultBinaryEntity
in interfaceIDataModel
-
setDefaultBinaryEntity
public void setDefaultBinaryEntity(boolean defaultBinaryEntity)
- Specified by:
setDefaultBinaryEntity
in interfaceIDataModel
-
isGenericOperationAllowed
public boolean isGenericOperationAllowed()
Flag represents whether this entity can be bind with generic operations- Specified by:
isGenericOperationAllowed
in interfaceIDataModel
- 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
-
-
-