|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Entity
Nested Class Summary | |
---|---|
static class |
Entity.PersistentState
Define all possible states of an entity. |
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Method Summary | ||
---|---|---|
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 |
|
de.espirit.or.schema.Identifier |
getIdentifier()
Return the identifier of this entity. |
|
KeyValue |
getKeyValue()
Return the business key of this entity. |
|
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. |
|
|
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 applied to this entity. |
|
|
setValue(Attribute<T> attribute,
T value)
Set the value of the attribute attribute to value . |
|
|
setValue(String name,
T value)
Set the value of the attribute name to value . |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Method Detail |
---|
@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 for
attribute
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 attribut
IllegalArgumentException
- if the attribut specified by the given name is no list attribute
de.espirit.or.ORException
@Nullable <T> T getValue(Attribute<T> attribute) throws de.espirit.or.ORException
null
.
attribute
- the attribute to get the value for
null
(e.g. if entity is deleted)
de.espirit.or.ORException
<T> void setValue(@NotNull String name, 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 attribute
de.espirit.or.ORException
<T> void setValue(@NotNull Attribute<T> attribute, 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
de.espirit.or.schema.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 KeyValue getKeyValue()
Entity.PersistentState getState()
boolean isReleased()
Long.MAX_VALUE
.
void rollback()
@NotNull Session getSession()
Entity copy() throws de.espirit.or.ORException
de.espirit.or.ORException
void copyFrom(@NotNull Entity entity) throws de.espirit.or.ORException
entity
to this entity.
A deep copy is done if the attribute of the value is simple or it is aggregated by value
else a shallow copy.
de.espirit.or.ORException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |