程序包 org.hibernate

类 EmptyInterceptor

    • 字段详细资料

      • INSTANCE

        public static final Interceptor INSTANCE
        The singleton reference.
    • 构造器详细资料

      • EmptyInterceptor

        protected EmptyInterceptor()
    • 方法详细资料

      • onDelete

        public void onDelete​(Object entity,
                             Serializable id,
                             Object[] state,
                             String[] propertyNames,
                             Type[] types)
        从接口复制的说明: Interceptor
        Called before an object is deleted. It is not recommended that the interceptor modify the state.
        指定者:
        onDelete 在接口中 Interceptor
        参数:
        entity - The entity instance being deleted
        id - The identifier of the entity
        state - The state of the entity
        propertyNames - The names of the entity properties.
        types - The types of the entity properties
      • onFlushDirty

        public boolean onFlushDirty​(Object entity,
                                    Serializable id,
                                    Object[] currentState,
                                    Object[] previousState,
                                    String[] propertyNames,
                                    Type[] types)
        从接口复制的说明: Interceptor
        Called when an object is detected to be dirty, during a flush. The interceptor may modify the detected currentState, which will be propagated to both the database and the persistent object. Note that not all flushes end in actual synchronization with the database, in which case the new currentState will be propagated to the object, but not necessarily (immediately) to the database. It is strongly recommended that the interceptor not modify the previousState.

        NOTE: The indexes across the currentState, previousState, propertyNames and types arrays match.

        指定者:
        onFlushDirty 在接口中 Interceptor
        参数:
        entity - The entity instance detected as being dirty and being flushed
        id - The identifier of the entity
        currentState - The entity's current state
        previousState - The entity's previous (load time) state.
        propertyNames - The names of the entity properties
        types - The types of the entity properties
        返回:
        true if the user modified the currentState in any way.
      • onLoad

        public boolean onLoad​(Object entity,
                              Serializable id,
                              Object[] state,
                              String[] propertyNames,
                              Type[] types)
        从接口复制的说明: Interceptor
        Called just before an object is initialized. The interceptor may change the state, which will be propagated to the persistent object. Note that when this method is called, entity will be an empty uninitialized instance of the class.

        NOTE: The indexes across the state, propertyNames and types arrays match.

        指定者:
        onLoad 在接口中 Interceptor
        参数:
        entity - The entity instance being loaded
        id - The identifier value being loaded
        state - The entity state (which will be pushed into the entity instance)
        propertyNames - The names of the entity properties, corresponding to the state.
        types - The types of the entity properties, corresponding to the state.
        返回:
        true if the user modified the state in any way.
      • onSave

        public boolean onSave​(Object entity,
                              Serializable id,
                              Object[] state,
                              String[] propertyNames,
                              Type[] types)
        从接口复制的说明: Interceptor
        Called before an object is saved. The interceptor may modify the state, which will be used for the SQL INSERT and propagated to the persistent object.
        指定者:
        onSave 在接口中 Interceptor
        参数:
        entity - The entity instance whose state is being inserted
        id - The identifier of the entity
        state - The state of the entity which will be inserted
        propertyNames - The names of the entity properties.
        types - The types of the entity properties
        返回:
        true if the user modified the state in any way.
      • postFlush

        public void postFlush​(Iterator entities)
        从接口复制的说明: Interceptor
        Called after a flush that actually ends in execution of the SQL statements required to synchronize in-memory state with the database.
        指定者:
        postFlush 在接口中 Interceptor
        参数:
        entities - The entities that were flushed.
      • preFlush

        public void preFlush​(Iterator entities)
        从接口复制的说明: Interceptor
        Called before a flush.
        指定者:
        preFlush 在接口中 Interceptor
        参数:
        entities - The entities to be flushed.
      • isTransient

        public Boolean isTransient​(Object entity)
        从接口复制的说明: Interceptor
        Called to distinguish between transient and detached entities. The return value determines the state of the entity with respect to the current session.
        • Boolean.TRUE - the entity is transient
        • Boolean.FALSE - the entity is detached
        • null - Hibernate uses the unsaved-value mapping and other heuristics to determine if the object is unsaved
        指定者:
        isTransient 在接口中 Interceptor
        参数:
        entity - a transient or detached entity
        返回:
        Boolean or null to choose default behaviour
      • instantiate

        public Object instantiate​(String entityName,
                                  EntityMode entityMode,
                                  Serializable id)
        从接口复制的说明: Interceptor
        Instantiate the entity class. Return null to indicate that Hibernate should use the default constructor of the class. The identifier property of the returned instance should be initialized with the given identifier.
        指定者:
        instantiate 在接口中 Interceptor
        参数:
        entityName - the name of the entity
        entityMode - The type of entity instance to be returned.
        id - the identifier of the new instance
        返回:
        an instance of the class, or null to choose default behaviour
      • findDirty

        public int[] findDirty​(Object entity,
                               Serializable id,
                               Object[] currentState,
                               Object[] previousState,
                               String[] propertyNames,
                               Type[] types)
        从接口复制的说明: Interceptor
        Called from flush(). The return value determines whether the entity is updated
        • an array of property indices - the entity is dirty
        • an empty array - the entity is not dirty
        • null - use Hibernate's default dirty-checking algorithm
        指定者:
        findDirty 在接口中 Interceptor
        参数:
        entity - The entity for which to find dirty properties.
        id - The identifier of the entity
        currentState - The current entity state as taken from the entity instance
        previousState - The state of the entity when it was last synchronized (generally when it was loaded)
        propertyNames - The names of the entity properties.
        types - The types of the entity properties
        返回:
        array of dirty property indices or null to indicate Hibernate should perform default behaviour
      • getEntityName

        public String getEntityName​(Object object)
        从接口复制的说明: Interceptor
        Get the entity name for a persistent or transient instance.
        指定者:
        getEntityName 在接口中 Interceptor
        参数:
        object - an entity instance
        返回:
        the name of the entity
      • getEntity

        public Object getEntity​(String entityName,
                                Serializable id)
        从接口复制的说明: Interceptor
        Get a fully loaded entity instance that is cached externally.
        指定者:
        getEntity 在接口中 Interceptor
        参数:
        entityName - the name of the entity
        id - the instance identifier
        返回:
        a fully initialized entity
      • afterTransactionBegin

        public void afterTransactionBegin​(Transaction tx)
        从接口复制的说明: Interceptor
        Called when a Hibernate transaction is begun via the Hibernate Transaction API. Will not be called if transactions are being controlled via some other mechanism (CMT, for example).
        指定者:
        afterTransactionBegin 在接口中 Interceptor
        参数:
        tx - The Hibernate transaction facade object
      • afterTransactionCompletion

        public void afterTransactionCompletion​(Transaction tx)
        从接口复制的说明: Interceptor
        Called after a transaction is committed or rolled back.
        指定者:
        afterTransactionCompletion 在接口中 Interceptor
        参数:
        tx - The Hibernate transaction facade object
      • beforeTransactionCompletion

        public void beforeTransactionCompletion​(Transaction tx)
        从接口复制的说明: Interceptor
        Called before a transaction is committed (but not before rollback).
        指定者:
        beforeTransactionCompletion 在接口中 Interceptor
        参数:
        tx - The Hibernate transaction facade object
      • onPrepareStatement

        public String onPrepareStatement​(String sql)
        从接口复制的说明: Interceptor
        Called when sql string is being prepared.
        指定者:
        onPrepareStatement 在接口中 Interceptor
        参数:
        sql - sql to be prepared
        返回:
        original or modified sql