public interface EntityId extends SimpleDatatype<String>
entity. EntityId is build out of the following parts:
object-id - unique ID of an object of a particular type.type-id - is the ID of the type of the object identified by this EntityId .revision - a object can potentially have multiple revisions (as history of changes). A
EntityId uniquely identifies the specific revision.primary key the revision and type of
an object do not change. This allows to create an instance of the identified object without additional costs (e.g.
database lookup) by a dynamic proxy using lazy loading. EntityId has a compact string representation that can be converted back to an
EntityId. Therefore, the implementation shall provide a String-arg constructor.| Modifier and Type | Field and Description |
|---|---|
static long |
OBJECT_ID_ILLEGAL
An illegal value for the
object-id. |
static long |
OBJECT_ID_MINIMUM_CUSTOM
|
static int |
RADIX
This radix is used to convert numbers to/from strings.
|
static String |
SEPARATOR
the delimiter used in the string representations of an id
|
static char |
SEPARATOR_CHAR
The delimiter used in the string representations of an id.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getObjectId()
This method gets the
unique identifier of an
entity (or any other object). |
Number |
getRevision()
This method gets the number of the specific revision of the object referenced by this
EntityId. |
long |
getTypeId()
This method gets the identifier representing the type of the referenced
entity or
object. |
String |
toString()
The string representation of the
EntityId in the following form: |
getValuestatic final int RADIX
static final long OBJECT_ID_ILLEGAL
object-id. This is reserved for undefined values.static final long OBJECT_ID_MINIMUM_CUSTOM
object-id that can be used for custom entities. All
object-IDs lower than this are reserved for master-data entities provided with the application. static final char SEPARATOR_CHAR
static final String SEPARATOR
long getObjectId()
unique identifier of an
entity (or any other object).GenericEntity.getId()long getTypeId()
entity or
object. The type is typically directly related to the Class reflecting the object. However, in dynamically
or mixed typed object-worlds (often used in content-management-systems) two instances of the same java
Class may be considered to have different types that can only be determined at runtime. To resolve an
EntityId a central component is required that can map the getTypeId() to the actual type (e.g.
Class object) and vice versa.Number getRevision()
EntityId. If the
associated object is NOT version controlled (e.g. a class or field), then the revision will always be
null. null always points to the latest revision of an
object.null for the latest revision.RevisionedEntity.getRevision(),
RevisionedEntity.LATEST_REVISIONString toString()
EntityId in the following form:
<TheobjectId>.<typeId>[.<revision>]
revision can be omitted if zero. All number values are encoded using the RADIX constant. String representation of this Datatype. While the general contract of
Object.toString() is very weak and mainly used for debugging, the contract here is very strong. The
returned String has to be suitable for end-users and official output to any kind of sink. NlsMessage for
this purpose and implement NlsObject if you want to support I18N/L10N.Copyright © 2001–2016 mmm-Team. All rights reserved.