Package mc.core.model.base
Class EntityBase
java.lang.Object
mc.core.model.base.EntityBase
- All Implemented Interfaces:
Serializable,IBaseEntity,ICoreEntity,IEntity,ISortableEntity
- Direct Known Subclasses:
ComplexEntity,SimpleEntity,TypeEntity
@MappedSuperclass
public abstract class EntityBase
extends Object
implements IEntity, ISortableEntity
Baseclass for most entity classes except the most simple ones.
Fields:
Fields:
nameanddescription: Resources, mulitilanguage text used as main display fields.internalDescription: internal identifier that is known in the system since id is created by database. Sholid by unique within subclassnamespace: if entities need to be differentiated by namespace, currently not usedcollection: used mainly by ICollectionManaged entities to reference collection in which entity residesisSystem: signal that entity is internal and in most cases sholid not be displayed or changed by userprio: generally used for ordering entities of same kind
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic enumno property fields, used as parameter constant and label key -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetDescription(Locale locale) booleangetFlag(int mask) booleangetName()intgetPrio()inthashCode()voidsetCollection(Collection collection) voidsetDescription(String descr, Locale locale) WARNING: use only if entity is new (transient).voidsetDescription(Resource description) voidsetFlag(boolean value, int mask) voidsetInternalDescription(String internalDescription) voidsetIsSystem(boolean system) voidWARNING: use only if entity is new (transient).voidvoidsetNamespace(String namespace) voidsetPrio(int prio) toString()for logging/debuggingMethods inherited from interface mc.core.model.base.IBaseEntity
getId, setId
-
Field Details
-
INTDESC_COLUMN_LENGTH
public static final int INTDESC_COLUMN_LENGTH- See Also:
-
-
Constructor Details
-
EntityBase
public EntityBase() -
EntityBase
copy constructor. source EntityBase must be attached to persistence context
-
-
Method Details
-
getDescription
- Specified by:
getDescriptionin interfaceIEntity- Returns:
- Description of entity in multiple locales. Might be
null.
-
getName
-
getNamespace
-
getCollection
- Returns:
- Primary collection the object is associated with.
-
setDescription
-
setInternalDescription
- Specified by:
setInternalDescriptionin interfaceIEntity- Parameters:
internalDescription- Identifier of entity (meaningful in combination with the entity class). Must be unique if internalDescription property is defined as unique.
-
setName
-
setName
WARNING: use only if entity is new (transient). will throw exception for persistent entity or resource -
setDescription
WARNING: use only if entity is new (transient). will throw exception for persistent entity or resource -
setNamespace
-
setCollection
-
getIsSystem
public boolean getIsSystem() -
setIsSystem
public void setIsSystem(boolean system) -
getPrio
public int getPrio()- Specified by:
getPrioin interfaceIEntity- Specified by:
getPrioin interfaceISortableEntity- Returns:
- Sort key used when ordering entities.
-
setPrio
public void setPrio(int prio) - Specified by:
setPrioin interfaceISortableEntity
-
getInternalDescription
- Specified by:
getInternalDescriptionin interfaceIEntity- Returns:
- Unique identifier in combination with entity class if internalDescription property is defined as unique.
Might be
null.
-
getFlag
public boolean getFlag(int mask) -
setFlag
public void setFlag(boolean value, int mask) -
getName
- Returns:
- Name of entity given
locale. Returnsnullif no translation in givenlocaleexists.
-
getDescription
- Returns:
- Description of entity given
locale. Returnsnullif no translation in givenlocaleexists.
-
equals
-
hashCode
public int hashCode() -
toString
for logging/debugging
-