Class AbstractSessionOnlyEntity
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.pojo.AbstractHibernateEntity
ch.tocco.nice2.persist.core.impl.hibernate.pojo.AbstractSessionOnlyEntity
- All Implemented Interfaces:
EntityReference
,Entity
,EntityImplementor
Entity
base class for 'session-only' entities which are not mapped by hibernate.-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.persist.core.api.entity.Entity
Entity.State
-
Field Summary
Fields inherited from class ch.tocco.nice2.persist.core.impl.hibernate.pojo.AbstractHibernateEntity
entityContext, entityInterceptor, logger, wasDeleted
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable PrimaryKey
getKey()
Get the primary key of this entity.<T> T
getOldValue
(String field, Class<T> targetType) Get the old value of a field.getState()
Get the current state of the entity.getTouchedProperties
(Function<String, Boolean> filter) Resolve a relation.void
syncInverseCollection
(RelationModel relationModel, Entity entity, boolean added) Methods inherited from class ch.tocco.nice2.persist.core.impl.hibernate.pojo.AbstractHibernateEntity
delete, getAutoFieldsDisabled, getChangedFields, getContext, getLogger, getManager, getModel, getRelatedEntity, getRelatedEntityOrNull, getTouchedFields, getTouchedRelations, getValue, getValue, getValue, getValue, getValue, getValue, getValueMap, internalGetValue, internalSetValue, isFieldChanged, isFieldTouched, isUpdatable, joinTx, markDeleted, resolveField, setAutoFieldsDisabled, setEntityContext, setValue, thisInstanceOrProxyIfAvailable, toString, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.entity.Entity
getBool, getDate, getDateTime, getDecimal, getDouble, getFloat, getInt, getLong, getShort, getString, getTime, hasKey, requireBool, requireDate, requireDateTime, requireDecimal, requireDouble, requireFloat, requireInt, requireKey, requireLong, requireShort, requireString, requireTime, requireValue, requireValue, requireValue, requireValue, requireValue, requireValue, validate
-
Constructor Details
-
AbstractSessionOnlyEntity
public AbstractSessionOnlyEntity()
-
-
Method Details
-
getInnerInterceptor
- Specified by:
getInnerInterceptor
in classAbstractHibernateEntity
-
getTouchedProperties
- Specified by:
getTouchedProperties
in classAbstractHibernateEntity
-
syncInverseCollection
- Specified by:
syncInverseCollection
in classAbstractHibernateEntity
-
getKey
Description copied from interface:Entity
Get the primary key of this entity.- Returns:
- The primary key of this entity, or null if in CONCEPTION state.
- See Also:
-
getOldValue
Description copied from interface:Entity
Get the old value of a field.- Parameters:
field
- The field to get the old value from.targetType
- The target Java type.- Returns:
- the old value of the field (cached value read from database).
-
resolve
Description copied from interface:Entity
Resolve a relation. Throws if there is no such relation, check the model if you're unsure!The returned RelationQuery may be modified by interceptors already when you receive it. For example, in the entity system, there is (as of now) the NiceModelEntityInterceptorFactory which appends the default ordering rules of the EntityModel on query.
- Parameters:
relation
- The name of the relation- Returns:
- The executable
RelationQuery
.
-
getState
Description copied from interface:Entity
Get the current state of the entity.- Returns:
- The current state of the entity.
-