Interface IMetaObject
-
public interface IMetaObject
Represents an entity in the domain model. Current names are used in javadoc, even though the classes are still named after legacy objects for compatibility reasons.- MetaObject refers to an entity
- SuperObject refers to a generalization
- SubObject refers to an entity that has a generalization
- MetaPrimitive refers to a attribute
- Member refers to an attribute as well
- NonVirtual refers to a stored attribute
- Virtual refers to a calculated attribute
- DataValidations refers to a validation rule
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description java.util.List<? extends IDataValidation>
getDataValidations()
Returns all validation rules that are defined for this entity.java.util.List<? extends IDataValidation>
getDataValidationsByMember(java.lang.String memberName)
Returns all validation rules that are defined for the specified attribute.IMetaAssociation
getDeclaredMetaAssociationChild(java.lang.String name)
Returns the association with the specified name where this entity is a child.IMetaAssociation
getDeclaredMetaAssociationParent(java.lang.String name)
Returns the association with the specified name where this entity is a parent.java.util.Collection<? extends IMetaAssociation>
getDeclaredMetaAssociationsChild()
Returns all associations where this entity is a child.java.util.Collection<? extends IMetaAssociation>
getDeclaredMetaAssociationsParent()
Returns all associations where this entity is a parent.IMetaPrimitive
getDeclaredMetaPrimitive(java.lang.String name)
Returns the attribute with the specified name.java.util.Collection<? extends IMetaPrimitive>
getDeclaredMetaPrimitives()
Returns all attributes that are declared in this entity.short
getId()
Deprecated.since 9.24.java.util.List<? extends IMetaObjectIndex>
getIndices()
Returns all indices that are defined for this entity.IMetaAssociation
getMetaAssociationChild(java.lang.String name)
Returns the association with the specified name where this entity is a child.IMetaAssociation
getMetaAssociationParent(java.lang.String name)
Returns the association with the specified name where this entity is a parent.java.util.Collection<? extends IMetaAssociation>
getMetaAssociationsChild()
Returns all associations where this entity is a child.java.util.Collection<? extends IMetaAssociation>
getMetaAssociationsParent()
Returns all associations where this entity is a parent.java.util.List<? extends IMetaObjectAccess>
getMetaObjectAccesses()
Returns all access rules that apply to this entity.java.util.List<? extends IMetaObjectAccess>
getMetaObjectAccessesWithoutXPath(IContext context)
Returns the access rules with XPath constraints for the specified context that apply to this entity.java.util.List<? extends IMetaObjectAccess>
getMetaObjectAccessesWithXPath(IContext context)
Returns the security rules (access control lists) for the specified context that apply to this entity.IMetaPrimitive
getMetaPrimitive(java.lang.String name)
Returns the attribute with the specified name.java.util.Collection<? extends IMetaPrimitive>
getMetaPrimitives()
Returns all attributes of this entity.java.util.UUID
getModelGUID()
Returns the identifier of the modeled entity which is the base of this meta object.java.lang.String
getModuleName()
Returns the name of the module in which this entity is declared.java.lang.String
getName()
Returns the name of the entity.java.util.Collection<? extends IMetaPrimitive>
getNonVirtualDeclaredMetaPrimitives()
Returns all stored (non-virtual) attributes of this entity.java.util.List<? extends IMetaObject>
getSubObjects()
Returns all entities that have declared this entity as a generalization, either directly or indirectly through other generalizations.java.lang.String
getSuperName()
Returns the name of the direct generalizations of this entity (if any).IMetaObject
getSuperObject()
Returns the (direct) generalization of this entity if it exists.java.util.List<? extends IMetaObject>
getSuperObjects()
Returns all generalizations of this entity.boolean
hasChangedByAttr()
Returns whether this entity has a 'changedBy' system member.boolean
hasChangedDateAttr()
Returns whether this entity has a 'changedDate' system member.boolean
hasCreatedDateAttr()
Returns whether this entity has a 'createdDate' system member.boolean
hasMetaDataAccess(IContext context)
Returns whether the specified context can access meta-data for this entity.boolean
hasOwnerAttr()
Returns whether this entity has an 'owner' system member.boolean
isFileDocument()
Returns whether this entity is a file document entity.java.lang.Boolean
isPersistable()
Returns whether this entity is persistable (i.e.boolean
isRemote()
Returns whether this entity exists somewhere else than in the database (or in the client in case of non-persistable entities).boolean
isRemoteFileEntity()
Returns whether this entity is a remote file entity and contains a binary attribute.default boolean
isSubClassOf(IMetaObject superObject)
Returns whether this entity has the specified entity as a generalization, either directly or indirectly through other generalizations.boolean
isSubClassOf(java.lang.String superObject)
Returns whether this entity has the specified entity as a generalization, either directly or indirectly through other generalizations.boolean
isUser()
Returns whether this entity is a (system) user entity.
-
-
-
Method Detail
-
getModuleName
java.lang.String getModuleName()
Returns the name of the module in which this entity is declared.- Returns:
- the module name
-
getName
java.lang.String getName()
Returns the name of the entity.- Returns:
- the entity name
-
getSuperName
java.lang.String getSuperName()
Returns the name of the direct generalizations of this entity (if any).- Returns:
- the name of the generalization if it exists, null otherwise
-
getSuperObject
IMetaObject getSuperObject()
Returns the (direct) generalization of this entity if it exists.- Returns:
- the generalization if it exists, null otherwise
-
getSuperObjects
java.util.List<? extends IMetaObject> getSuperObjects()
Returns all generalizations of this entity. All generalizations are returned, including generalizations of generalizations.- Returns:
- all generalizations or an empty list if no generalizations exists
-
getSubObjects
java.util.List<? extends IMetaObject> getSubObjects()
Returns all entities that have declared this entity as a generalization, either directly or indirectly through other generalizations.- Returns:
- all entities that generalize from this entity or an empty list if none exist
-
isSubClassOf
default boolean isSubClassOf(IMetaObject superObject)
Returns whether this entity has the specified entity as a generalization, either directly or indirectly through other generalizations. Note that an entity is also considered a sub-class of itself.- Parameters:
superObject
- the entity to check- Returns:
- true if the specified entity is a generalization, false otherwise
-
isSubClassOf
boolean isSubClassOf(java.lang.String superObject)
Returns whether this entity has the specified entity as a generalization, either directly or indirectly through other generalizations. Note that an entity is also considered a sub-class of itself.- Parameters:
superObject
- name of the entity to check- Returns:
- true if the specified entity is a generalization, false otherwise
-
isPersistable
java.lang.Boolean isPersistable()
Returns whether this entity is persistable (i.e. storeable in the Mendix database).- Returns:
- true if this entity is persistable, false otherwise
-
hasCreatedDateAttr
boolean hasCreatedDateAttr()
Returns whether this entity has a 'createdDate' system member.- Returns:
- true if this entity has a 'createdDate' member, false otherwise
-
hasChangedDateAttr
boolean hasChangedDateAttr()
Returns whether this entity has a 'changedDate' system member.- Returns:
- true if this entity has a 'changedDate' member, false otherwise
-
hasOwnerAttr
boolean hasOwnerAttr()
Returns whether this entity has an 'owner' system member.- Returns:
- true if this entity has an 'owner' member, false otherwise
-
hasChangedByAttr
boolean hasChangedByAttr()
Returns whether this entity has a 'changedBy' system member.- Returns:
- true if this entity has a 'changedBy' member, false otherwise
-
getMetaPrimitives
java.util.Collection<? extends IMetaPrimitive> getMetaPrimitives()
Returns all attributes of this entity. All attributes are returned: those declared in the entity itself as well as those declared in generalizations (if any). An attribute exists for each primitive value that is defined in an entity.- Returns:
- all attributes, including those declared in generalizations
-
getMetaPrimitive
IMetaPrimitive getMetaPrimitive(java.lang.String name)
Returns the attribute with the specified name. The attribute can either be declared in this entity or in a generalization (if any).- Parameters:
name
- the name of the attribute to return- Returns:
- the attribute for the given name if it exists in this entity or one of its generalizations, null otherwise
-
getDeclaredMetaPrimitives
java.util.Collection<? extends IMetaPrimitive> getDeclaredMetaPrimitives()
Returns all attributes that are declared in this entity. Only attributes declared in the entity itself are returned, attributes declared in generalizations (if any) are not returned.- Returns:
- all attributes that are declared in this entity, excluding attributes declared in generalizations
-
getNonVirtualDeclaredMetaPrimitives
java.util.Collection<? extends IMetaPrimitive> getNonVirtualDeclaredMetaPrimitives()
Returns all stored (non-virtual) attributes of this entity. Only attributes declared in the entity itself are returned, attributes declared in generalizations (if any) are not returned.- Returns:
- all stored attributes that are declared in this entity, excluding attributes declared in generalizations
-
getDeclaredMetaPrimitive
IMetaPrimitive getDeclaredMetaPrimitive(java.lang.String name)
Returns the attribute with the specified name. The attribute must declared in this entity, not in a generalization (if any).- Parameters:
name
- the name of the attribute to return- Returns:
- the attribute for the given name if it exists and is declared in the entity itself, null otherwise
-
getMetaAssociationsChild
java.util.Collection<? extends IMetaAssociation> getMetaAssociationsChild()
Returns all associations where this entity is a child. All associations are returned: those declared in the entity itself as well as those declared in generalizations (if any).- Returns:
- all child associations, including those declared in generalizations
-
getMetaAssociationChild
IMetaAssociation getMetaAssociationChild(java.lang.String name)
Returns the association with the specified name where this entity is a child. The association can either be declared in this entity or in a generalization (if any).- Parameters:
name
- the name of the association to return- Returns:
- the child association for the given name if it exists in this entity or one of its generalizations, null otherwise
-
getMetaAssociationsParent
java.util.Collection<? extends IMetaAssociation> getMetaAssociationsParent()
Returns all associations where this entity is a parent. All associations are returned: those declared in the entity itself as well as those declared in generalizations (if any).- Returns:
- all parent associations, including those declared in generalizations
-
getMetaAssociationParent
IMetaAssociation getMetaAssociationParent(java.lang.String name)
Returns the association with the specified name where this entity is a parent. The association can either be declared in this entity or in a generalization (if any).- Parameters:
name
- the name of the association to return- Returns:
- the parent association for the given name if it exists in this entity or one of its generalizations, null otherwise
-
getDeclaredMetaAssociationsChild
java.util.Collection<? extends IMetaAssociation> getDeclaredMetaAssociationsChild()
Returns all associations where this entity is a child. Only associations declared in the entity itself are returned, associations declared in generalizations (if any) are not returned.- Returns:
- all child associations that are declared in this entity, excluding associations declared in generalizations
-
getDeclaredMetaAssociationChild
IMetaAssociation getDeclaredMetaAssociationChild(java.lang.String name)
Returns the association with the specified name where this entity is a child. The association must be declared in this entity, not in a generalization (if any).- Parameters:
name
- the name of the association to return- Returns:
- the child association for the given name if it exists and is declared in the entity itself, null otherwise
-
getDeclaredMetaAssociationsParent
java.util.Collection<? extends IMetaAssociation> getDeclaredMetaAssociationsParent()
Returns all associations where this entity is a parent. Only associations declared in the entity itself are returned, associations declared in generalizations (if any) are not returned.- Returns:
- all parent associations that are declared in this entity, excluding associations declared in generalizations
-
getDeclaredMetaAssociationParent
IMetaAssociation getDeclaredMetaAssociationParent(java.lang.String name)
Returns the association with the specified name where this entity is a parent. The association must be declared in this entity, not in a generalization (if any).- Parameters:
name
- the name of the association to return- Returns:
- the parent association for the given name if it exists and is declared in the entity itself, null otherwise
-
getDataValidations
java.util.List<? extends IDataValidation> getDataValidations()
Returns all validation rules that are defined for this entity.- Returns:
- all validation rules or an empty list if none exist
-
getDataValidationsByMember
java.util.List<? extends IDataValidation> getDataValidationsByMember(java.lang.String memberName)
Returns all validation rules that are defined for the specified attribute.- Parameters:
memberName
- the name of the attribute to return validations rules for- Returns:
- all validation rules for the given attribute or an empty list if none exist
-
getIndices
java.util.List<? extends IMetaObjectIndex> getIndices()
Returns all indices that are defined for this entity.- Returns:
- the indices or an empty list if none exist
-
getMetaObjectAccesses
java.util.List<? extends IMetaObjectAccess> getMetaObjectAccesses()
Returns all access rules that apply to this entity.- Returns:
- all access rules or an empty list if none apply
-
getMetaObjectAccessesWithoutXPath
java.util.List<? extends IMetaObjectAccess> getMetaObjectAccessesWithoutXPath(IContext context)
Returns the access rules with XPath constraints for the specified context that apply to this entity. Only those rules are returned that apply to the user roles of the specified context.- Parameters:
context
- the context to use for filtering the security rules- Returns:
- the applicable access rules that have XPath constraints or an empty list if none apply
-
getMetaObjectAccessesWithXPath
java.util.List<? extends IMetaObjectAccess> getMetaObjectAccessesWithXPath(IContext context)
Returns the security rules (access control lists) for the specified context that apply to this entity. Only those rules are returned that apply to the user roles of the specified context.- Parameters:
context
- the context to use for filtering the security rules- Returns:
- the applicable access rules that have no XPath constraints or an empty list if none apply
-
getModelGUID
java.util.UUID getModelGUID()
Returns the identifier of the modeled entity which is the base of this meta object.- Returns:
- the identifier of the modeled entity
-
getId
@Deprecated short getId()
Deprecated.since 9.24. This method was exposed for internal purposes. There is no replacement.Returns the (short) identifier of the meta object, generated by the connection bus (database connection). Each meta object has a unique identifier that is used in client communication.- Returns:
- the identifier
-
isRemote
boolean isRemote()
Returns whether this entity exists somewhere else than in the database (or in the client in case of non-persistable entities).- Returns:
- true if this entity needs to be stored and retrieved from a non-local source, false otherwise
-
isRemoteFileEntity
boolean isRemoteFileEntity()
Returns whether this entity is a remote file entity and contains a binary attribute.- Returns:
- true if this entity is a remote file entity and contains a binary attribute, false otherwise
-
hasMetaDataAccess
boolean hasMetaDataAccess(IContext context)
Returns whether the specified context can access meta-data for this entity.- Parameters:
context
- the context to check- Returns:
- true if the context has meta-data access, false otherwise
-
isUser
boolean isUser()
Returns whether this entity is a (system) user entity.- Returns:
- true if the entity is a user, false otherwise
-
isFileDocument
boolean isFileDocument()
Returns whether this entity is a file document entity.- Returns:
- true if the entity is a file document, false otherwise
-
-