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 Entity
Entity.State -
Field Summary
Fields inherited from class AbstractHibernateEntity
entityContext, entityInterceptor, logger, wasDeleted -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable PrimaryKeygetKey()Get the primary key of this entity.<T> TgetOldValue(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.voidsyncInverseCollection(RelationModel relationModel, Entity entity, boolean added) Methods inherited from class AbstractHibernateEntity
delete, getAutoFieldsDisabled, getChangedFields, getContext, getLogger, getManager, getModel, getRelatedEntity, getRelatedEntityOrNull, getTouchedRelations, getValue, getValue, getValue, getValue, getValue, getValue, getValueMap, internalGetValue, internalSetValue, isFieldChanged, isUpdatable, joinTx, markDeleted, resolveField, setAutoFieldsDisabled, setEntityContext, setValue, thisInstanceOrProxyIfAvailable, toString, validateMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Entity
getBool, getDate, getDateTime, getDecimal, getDouble, getFloat, getInt, getLong, getShort, getString, getTime, hasKey, requireBool, requireDate, requireDateTime, requireDecimal, requireDouble, requireFloat, requireInt, requireKey, requireLong, requireOldValue, requireShort, requireString, requireTime, requireValue, requireValue, requireValue, requireValue, requireValue, requireValue, validate
-
Constructor Details
-
AbstractSessionOnlyEntity
public AbstractSessionOnlyEntity()
-
-
Method Details
-
getInnerInterceptor
- Specified by:
getInnerInterceptorin classAbstractHibernateEntity
-
getTouchedProperties
- Specified by:
getTouchedPropertiesin classAbstractHibernateEntity
-
syncInverseCollection
- Specified by:
syncInverseCollectionin classAbstractHibernateEntity
-
getKey
Description copied from interface:EntityGet 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:EntityGet 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:EntityResolve 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:EntityGet the current state of the entity.- Returns:
- The current state of the entity.
-