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 Details

    • getModuleName

      String getModuleName()
      Returns the name of the module in which this entity is declared.
      Returns:
      the module name
    • getName

      String getName()
      Returns the name of the entity.
      Returns:
      the entity name
    • getSuperName

      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

      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

      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

      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
    • isPersistable

      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

      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(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

      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

      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(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

      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(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

      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(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

      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(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

      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(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

      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

      List<? extends IDataValidation> getDataValidationsByMember(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

      List<? extends IMetaObjectIndex> getIndices()
      Returns all indices that are defined for this entity.
      Returns:
      the indices or an empty list if none exist
    • getMetaObjectAccesses

      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

      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

      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

      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

      short getId()
      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
    • getRemoteSource

      @Deprecated String getRemoteSource()
      Deprecated.
      For internal use only, will be removed.
      Returns the source that is used to store and retrieve data for this entity, if the entity is remote * (see isRemote()).
      Returns:
      the source if the entity is remote, null 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