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 voidaddAssociation(PropertyType associationType, java.lang.String name, IDataModel dataModel)Add the associated datamodelvoidaddProperties(java.util.List<IProperty> addProperties)voidaddProperty(IProperty property)Add property to data modeljava.lang.StringgetId()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.IPropertygetPropertyByName(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.StringgetSchemaName()Gets the name of schema in which this datamodel resides in.booleanisBinaryEntity()booleanisDefaultBinaryEntity()booleanisGenericOperationAllowed()Flag represents whether this entity can be bind with generic operationsbooleanisRootEntity()RootEntity is true if it is either an argument or return type of an operationvoidsetBinaryEntity(boolean binaryEntity)voidsetDefaultBinaryEntity(boolean defaultBinaryEntity)voidsetGenericOperationAllowed(boolean genericOperationAllowed)Set true if generic operations are allowed in this dataModel.voidsetId(java.lang.String id)voidsetProperties(java.util.List<? extends IProperty> properties)Sets the properties of this datamodel.voidsetRelationships(java.util.List<Relationship> relationships)voidsetRequired(java.lang.String[] required)voidsetRootEntity(boolean value)voidsetSchemaName(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:AbstractAssetGets the identifier of this Asset- Specified by:
getIdin interfaceIAsset- Overrides:
getIdin classAbstractAsset- Returns:
- the identifier of this Asset
-
setId
public void setId(java.lang.String id)
- Overrides:
setIdin 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:
getSchemaNamein 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:
getPropertiesin 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:
setPropertiesin 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:
getRelationshipsin 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:IDataModelRootEntity is true if it is either an argument or return type of an operation- Specified by:
isRootEntityin interfaceIDataModel- Returns:
-
setRootEntity
public void setRootEntity(boolean value)
- Specified by:
setRootEntityin 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:
isBinaryEntityin interfaceIDataModel
-
setBinaryEntity
public void setBinaryEntity(boolean binaryEntity)
- Specified by:
setBinaryEntityin interfaceIDataModel
-
isDefaultBinaryEntity
public boolean isDefaultBinaryEntity()
- Specified by:
isDefaultBinaryEntityin interfaceIDataModel
-
setDefaultBinaryEntity
public void setDefaultBinaryEntity(boolean defaultBinaryEntity)
- Specified by:
setDefaultBinaryEntityin interfaceIDataModel
-
isGenericOperationAllowed
public boolean isGenericOperationAllowed()
Flag represents whether this entity can be bind with generic operations- Specified by:
isGenericOperationAllowedin 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-
-
-