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

public class AbstractSessionOnlyEntity extends AbstractHibernateEntity
Entity base class for 'session-only' entities which are not mapped by hibernate.
  • Constructor Details

    • AbstractSessionOnlyEntity

      public AbstractSessionOnlyEntity()
  • Method Details

    • getInnerInterceptor

      public EntityInterceptor getInnerInterceptor()
      Specified by:
      getInnerInterceptor in class AbstractHibernateEntity
    • getTouchedProperties

      protected Set<String> getTouchedProperties(Function<String,Boolean> filter)
      Specified by:
      getTouchedProperties in class AbstractHibernateEntity
    • syncInverseCollection

      public void syncInverseCollection(RelationModel relationModel, Entity entity, boolean added)
      Specified by:
      syncInverseCollection in class AbstractHibernateEntity
    • getKey

      @Nullable public @Nullable PrimaryKey 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

      @Nullable public <T> T getOldValue(String field, Class<T> targetType)
      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

      public RelationQuery resolve(String relation)
      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

      public Entity.State getState()
      Description copied from interface: Entity
      Get the current state of the entity.
      Returns:
      The current state of the entity.