Class ComplexEntity

java.lang.Object
mc.core.model.base.EntityBase
mc.core.model.base.ComplexEntity
All Implemented Interfaces:
Serializable, IBaseEntity, ICoreEntity, IEntity, ISortableEntity
Direct Known Subclasses:
Asset, AssetDerivate, Attribute, ClassificationHrc, EntityProfile, HrcEntity, Import, NavigationHrc, NodeHrc, Principal, ProfileBase, Project, ProjectTask, Publication

@Entity public abstract class ComplexEntity extends EntityBase
Base class that provides the main features that describe an entity with complex data and functionality. Usually the type of a ComplexEntity is used to configure which of the features are available and in which way, but there are also ComplexEntity without type, e.g. Collection, Principal.
If a subclass of ComplexEntity has a type it must be a dedicated subclass of ComplexTypeEntity.
See Also:
  • Constructor Details

    • ComplexEntity

      public ComplexEntity()
    • ComplexEntity

      public ComplexEntity(ComplexEntity source)
      copy constructor: set simple fields from properties given by source-ComplexEntity. source-ComplexEntity must be attached to persistence context
  • Method Details

    • getType

      public abstract ComplexTypeEntity getType()
      override in derived classes, return null if ComplexEntity-subclass is not type managed.
    • getId

      public long getId()
    • setId

      public void setId(long id)
    • setType

      public void setType(ComplexTypeEntity type)
      override in derived classes if ComplexEntity-subclass is type managed, else do nothing.
      be used by entity mapper
    • getExternalKey

      public String getExternalKey()
    • setExternalKey

      public void setExternalKey(String externalKey)
    • getInternalDescription

      public String getInternalDescription()
      Specified by:
      getInternalDescription in interface IEntity
      Overrides:
      getInternalDescription in class EntityBase
      Returns:
      Unique identifier in combination with entity class if internalDescription property is defined as unique. Might be null.
    • getMasterId

      public String getMasterId()
    • setMasterId

      public void setMasterId(String masterId)
    • getFileId

      public String getFileId()
      Returns:
      the fileId, reference to a file in the file content store.
    • setFileId

      public void setFileId(String fileId)
    • getFilename

      public String getFilename()
      Returns:
      the filename of a file, referenced by fileId and stored in the file content store.
    • setFilename

      public void setFilename(String filename)
    • getDateCreated

      public Calendar getDateCreated()
    • setDateCreated

      public void setDateCreated(Calendar dateCreated)
    • getDateModified

      public Calendar getDateModified()
    • setDateModified

      public void setDateModified(Calendar dateModified)
    • getPermissions

      public List<Permission> getPermissions()
    • setPermissions

      public void setPermissions(List<Permission> rights)
    • getStates

      public List<State> getStates()
      Returns:
      Currently active states across workflows.
    • setStates

      public void setStates(List<State> states)
    • getWatches

      public List<Watch> getWatches()
    • setWatches

      public void setWatches(List<Watch> watches)
    • getMemos

      public List<Memo> getMemos()
    • setMemos

      public void setMemos(List<Memo> memos)
    • getVersions

      public List<Version> getVersions()
    • setVersions

      public void setVersions(List<Version> versions)
    • getLifeCycleFlag

      public LifeCycleFlag getLifeCycleFlag()
      Only relevant if ComplexEntity has snapshot functionality or is not deleted from database upon user action.
      Returns:
      the LifeCycleFlag if exist, or null
      See Also:
    • setLifeCycleFlag

      public void setLifeCycleFlag(LifeCycleFlag lifeCycleFlag)
    • getMasterLocale

      public Locale getMasterLocale()
      Locale independent data of ComplexEntity should only be edited in master locale. Locale dependent data (texts, assets) serve as source for translation. Each ComplexEntity gets the current content locale as master locale when created.
      Returns:
      Locale
    • setMasterLocale

      public void setMasterLocale(Locale masterLocale)
    • getAttributes

      public List<EntityToAttribute> getAttributes()
    • setAttributes

      public void setAttributes(List<EntityToAttribute> attributes)
    • getRelatedEntities

      public List<EntityToEntity> getRelatedEntities()
      get the relations of this entity to other entities of all RelationTypes (the EntityToEntity objects, in which this entity is entity1)
      Returns:
      list of EntityToEntity objects
    • setRelatedEntities

      public void setRelatedEntities(List<EntityToEntity> relatedEntities)
    • getParameters

      public List<EntityParameter> getParameters()
      generic parameter to apply to a complex entity. can be used to store additional or project specific properties. keys must be defined by program logic - no configuration possible or needed.
      Returns:
      list of entity parameters of this complex entity, if any, or empty list
    • setParameters

      public void setParameters(List<EntityParameter> parameters)
    • getEntityDatas

      public List<EntityDataCE> getEntityDatas()
    • setEntityDatas

      public void setEntityDatas(List<EntityDataCE> entityDatas)
    • getEntityFilters

      public List<EntityFilter> getEntityFilters()
    • setEntityFilters

      public void setEntityFilters(List<EntityFilter> entityFilters)
    • getEntityOwner

      public User getEntityOwner()
      current owner for this complex entity. can be changed in front end. at insert set current session user as owner
    • setEntityOwner

      public void setEntityOwner(User user)
    • getCollectionToCEs

      public List<CollectionToEntity> getCollectionToCEs()
    • setCollectionToCEs

      public void setCollectionToCEs(List<CollectionToEntity> collectionToCEs)
    • isRightInheritanceDisabled

      public boolean isRightInheritanceDisabled()
    • setRightInheritanceDisabled

      public void setRightInheritanceDisabled(boolean disable)
    • getState

      public State getState(StateGroupType stateGroupType, Locale locale)
      Parameters:
      stateGroupType - mandatory
      locale - mandatory if stateGroupType is locale dependent
      Returns:
      the state in given stateGroupType, if stateGroupType is locale dependent in the given locale. Returns null if there is no such state. NOTE: ComplexEntity must be attached.
    • getStateGroupTypes

      public List<StateGroupType> getStateGroupTypes()
      type of ComplexEntity must be attached
      Returns:
      List of StateGroupType configured for this ComplexEntity, is no type of nothing configured empty list
    • addState

      public void addState(State newState)
    • getStatesToRemove

      public List<State> getStatesToRemove(StateGroupType stateGroupType, Locale locale)
      removes all states of group from object and returns the for deleting them through em. IMPORTANT INFO: there should only be one state of every state group per object, but db allows more than one (business logic must enforce that). cause of bug in earlier version there are objects with more than 1 state of a group. this methods returns all these states to fix existing data. ComplexEntity must be attached.
      Parameters:
      stateGroupType -
      locale -
      Returns:
      list with states already removed from object. delete them through em.
    • getHasObjectRights

      public boolean getHasObjectRights()
      type of ComplexEntity must be attached if exists
      Returns:
      true if object rights are configured for this ComplexEntity
    • isArchived

      public boolean isArchived()
    • isDeleted

      public boolean isDeleted()
    • isVisible

      public boolean isVisible()
    • getParameter

      public EntityParameter getParameter(String key)
    • getParameterValue

      public String getParameterValue(String key)
    • getEntityData

      public EntityDataCE getEntityData(String dataType)
    • getCollections

      public List<Collection> getCollections()
      Returns:
      list of secondary (linked) collections.
    • getCollections

      public List<Collection> getCollections(boolean includePrimary)
      Parameters:
      includePrimary - flag whether primary collection is added to list.
      Returns:
      list of primary (if includePrimary=true and primary collection!=null) and secondary (linked) collections.
    • isSecondaryCollection

      public boolean isSecondaryCollection(long collectionId)