Modifier and Type | Interface and Description |
---|---|
static class |
Entity.PersistentState
Define all possible states of an entity.
|
Modifier and Type | Method and Description |
---|---|
Entity |
copy()
Copies this entity.
|
void |
copyFrom(Entity entity)
Copy the values of the given
entity to this entity. |
Collection<String> |
getAttributeNames()
Return a collection of the attributes declared for this entity.
|
EntityType |
getEntityType()
Return the type of this entity
|
UUID |
getGid()
Returns the gid of this entity, if it already exists or
null . |
Identifier |
getIdentifier()
Return the identifier of this entity.
|
KeyValue |
getKeyValue()
Return the business key of this entity or
null if this entity is in state NEW |
List<Entity> |
getList(String name)
Return the value of the attribute specified by the given name as list.
|
Session |
getSession()
Returns the session that owns this entity
|
Entity.PersistentState |
getState()
Return the state of this entity.
|
<T> T |
getValue(Attribute<T> attribute)
Return the value of the given attribute or
null . |
Object |
getValue(String name)
Return the value of the
attribute specified by the given name . |
boolean |
isReleased()
Return true if this entity is released else false.
|
boolean |
isValid()
Return true if this entity is valid else false.
|
void |
refresh()
Refresh the content of this entity with the one stored in the DB.
|
void |
rollback()
Reset all changes of value attributes (i.e. no rollback of changes on relations).
|
void |
rollbackWithRelations()
Reset all changes, including relations (i.e. this may rollback delete operations of entities which has been set
in relation to this entity).
|
<T> void |
setValue(Attribute<T> attribute,
T value)
Set the value of the attribute
attribute to value . |
<T> void |
setValue(String name,
T value)
Set the value of the attribute
name to value . |
@Nullable Object getValue(String name) throws de.espirit.or.ORException
attribute
specified by the given name
.
If no attribute
exists with the given name then the returned is null
.name
- specifying the attribute to get the value forattribute
specified by the given name
or null
.de.espirit.or.ORException
@NotNull List<Entity> getList(String name) throws de.espirit.or.ORException
name
- the name of the list attributIllegalArgumentException
- if the attribut specified by the given name is no list attributede.espirit.or.ORException
@Nullable <T> T getValue(Attribute<T> attribute) throws de.espirit.or.ORException
null
.attribute
- the attribute to get the value fornull
(e.g. if entity is deleted)de.espirit.or.ORException
<T> void setValue(@NotNull String name, @Nullable T value) throws de.espirit.or.ORException
name
to value
.IllegalArgumentException
- if name
denotes not a valid attribute or value
is an
incorrect type for this attributede.espirit.or.ORException
<T> void setValue(@NotNull Attribute<T> attribute, @Nullable T value) throws de.espirit.or.ORException
attribute
to value
.de.espirit.or.ORException
EntityType getEntityType()
Collection<String> getAttributeNames()
boolean isValid() throws de.espirit.or.ORException
validator
in the
EntityType
.de.espirit.or.ORException
void refresh() throws de.espirit.or.ORException
de.espirit.or.ORException
Identifier getIdentifier()
KeyValue
but each version must have an unique identifier
which is used to retrieve the version from the database. In the temporal context the identifier is a composed
primary key it contains the key value of the entity and the following system columns:
valid from, valid to, release to
@Nullable UUID getGid()
null
.created
or modified legacy entities the gid
first becomes available after calling Session.commit()
null
if not created yet@Nullable KeyValue getKeyValue()
null
if this entity is in state NEW
@NotNull Entity.PersistentState getState()
boolean isReleased()
Long.MAX_VALUE
.void rollback()
rollbackWithRelations()
,
Session.rollback()
void rollbackWithRelations()
rollback()
,
Session.rollback()
Entity copy() throws de.espirit.or.ORException
de.espirit.or.ORException
Copyright © 2014 e-Spirit AG. All Rights Reserved. Build 5.0_BETA.500