Class AbstractPojoEntity
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.pojo.AbstractHibernateEntity
ch.tocco.nice2.persist.core.impl.hibernate.pojo.AbstractDirtyCheckingEntity
ch.tocco.nice2.persist.core.impl.hibernate.pojo.AbstractPojoEntity
- All Implemented Interfaces:
EntityReference
,Entity
,EntityImplementor
A base class for dynamically created
Entity
instances (see JavassistEntityPojoFactory
.
This class is used for all entities which are mapped by hibernate.
Used for XML based entities.-
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.protected boolean
isUnsaved
(@Nullable org.hibernate.engine.spi.EntityEntry entry) Resolve a relation.void
syncInverseCollection
(RelationModel relationModel, Entity entity, boolean added) Methods inherited from class ch.tocco.nice2.persist.core.impl.hibernate.pojo.AbstractDirtyCheckingEntity
doGetOldValue, getTouchedProperties, isDirty, markAsDirtyIfNecessary, resetDirty, setEntityContext
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, 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
-
AbstractPojoEntity
public AbstractPojoEntity()
-
-
Method Details
-
getInnerInterceptor
- Specified by:
getInnerInterceptor
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
.
-
syncInverseCollection
- Specified by:
syncInverseCollection
in classAbstractHibernateEntity
-
getState
Description copied from interface:Entity
Get the current state of the entity.- Returns:
- The current state of the entity.
-
isUnsaved
protected boolean isUnsaved(@Nullable @Nullable org.hibernate.engine.spi.EntityEntry entry) - Specified by:
isUnsaved
in classAbstractDirtyCheckingEntity
-