Package mc.core.model.base
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
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.
If a subclass of ComplexEntity has a type it must be a dedicated subclass of ComplexTypeEntity.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classcomparator, default is compare by prio.static classstatic enumno property fields, used as parameter constant and label keyNested classes/interfaces inherited from class mc.core.model.base.EntityBase
EntityBase.EntityComparator -
Field Summary
Fields inherited from class mc.core.model.base.EntityBase
INTDESC_COLUMN_LENGTH -
Constructor Summary
ConstructorsConstructorDescriptionComplexEntity(ComplexEntity source) copy constructor: set simple fields from properties given by source-ComplexEntity. -
Method Summary
Modifier and TypeMethodDescriptionvoidgetCollections(boolean includePrimary) getEntityData(String dataType) current owner for this complex entity.booleantype of ComplexEntity must be attached if existslonggetId()Only relevant if ComplexEntity has snapshot functionality or is not deleted from database upon user action.Locale independent data of ComplexEntity should only be edited in master locale.getMemos()getParameter(String key) generic parameter to apply to a complex entity.getParameterValue(String key) get the relations of this entity to other entities of all RelationTypes (the EntityToEntity objects, in which this entity is entity1)getState(StateGroupType stateGroupType, Locale locale) type of ComplexEntity must be attachedgetStatesToRemove(StateGroupType stateGroupType, Locale locale) removes all states of group from object and returns the for deleting them through em.abstract ComplexTypeEntitygetType()override in derived classes, return null if ComplexEntity-subclass is not type managed.booleanbooleanbooleanbooleanisSecondaryCollection(long collectionId) booleanvoidsetAttributes(List<EntityToAttribute> attributes) voidsetCollectionToCEs(List<CollectionToEntity> collectionToCEs) voidsetDateCreated(Calendar dateCreated) voidsetDateModified(Calendar dateModified) voidsetEntityDatas(List<EntityDataCE> entityDatas) voidsetEntityFilters(List<EntityFilter> entityFilters) voidsetEntityOwner(User user) voidsetExternalKey(String externalKey) voidvoidsetFilename(String filename) voidsetId(long id) voidsetLifeCycleFlag(LifeCycleFlag lifeCycleFlag) voidsetMasterId(String masterId) voidsetMasterLocale(Locale masterLocale) voidvoidsetParameters(List<EntityParameter> parameters) voidsetPermissions(List<Permission> rights) voidsetRelatedEntities(List<EntityToEntity> relatedEntities) voidsetRightInheritanceDisabled(boolean disable) voidvoidsetType(ComplexTypeEntity type) override in derived classes if ComplexEntity-subclass is type managed, else do nothing.
be used by entity mappervoidsetVersions(List<Version> versions) voidsetWatches(List<Watch> watches) Methods inherited from class mc.core.model.base.EntityBase
equals, getCollection, getDescription, getDescription, getFlag, getIsSystem, getName, getName, getNamespace, getPrio, hashCode, setCollection, setDescription, setDescription, setFlag, setInternalDescription, setIsSystem, setName, setName, setNamespace, setPrio, toString
-
Constructor Details
-
ComplexEntity
public ComplexEntity() -
ComplexEntity
copy constructor: set simple fields from properties given by source-ComplexEntity. source-ComplexEntity must be attached to persistence context
-
-
Method Details
-
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
override in derived classes if ComplexEntity-subclass is type managed, else do nothing.
be used by entity mapper -
getExternalKey
-
setExternalKey
-
getInternalDescription
- Specified by:
getInternalDescriptionin interfaceIEntity- Overrides:
getInternalDescriptionin classEntityBase- Returns:
- Unique identifier in combination with entity class if internalDescription property is defined as unique.
Might be
null.
-
getMasterId
-
setMasterId
-
getFileId
- Returns:
- the fileId, reference to a file in the file content store.
-
setFileId
-
getFilename
- Returns:
- the filename of a file, referenced by
fileIdand stored in the file content store.
-
setFilename
-
getDateCreated
-
setDateCreated
-
getDateModified
-
setDateModified
-
getPermissions
-
setPermissions
-
getStates
- Returns:
- Currently active states across workflows.
-
setStates
-
getWatches
-
setWatches
-
getMemos
-
setMemos
-
getVersions
-
setVersions
-
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
-
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
-
getAttributes
-
setAttributes
-
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
-
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
-
getEntityDatas
-
setEntityDatas
-
getEntityFilters
-
setEntityFilters
-
getEntityOwner
current owner for this complex entity. can be changed in front end. at insert set current session user as owner -
setEntityOwner
-
getCollectionToCEs
-
setCollectionToCEs
-
isRightInheritanceDisabled
public boolean isRightInheritanceDisabled() -
setRightInheritanceDisabled
public void setRightInheritanceDisabled(boolean disable) -
getState
- Parameters:
stateGroupType- mandatorylocale- 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
type of ComplexEntity must be attached- Returns:
- List of StateGroupType configured for this ComplexEntity, is no type of nothing configured empty list
-
addState
-
getStatesToRemove
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
-
getParameterValue
-
getEntityData
-
getCollections
- Returns:
- list of secondary (linked) collections.
-
getCollections
- 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)
-