Class AfterCommitListenerImpl

java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.listener.EventListenerAware<EntityListener>
ch.tocco.nice2.persist.core.impl.hibernate.listener.AfterCommitListenerImpl
All Implemented Interfaces:
AfterCommitListener, Serializable, org.hibernate.event.spi.PostCommitDeleteEventListener, org.hibernate.event.spi.PostCommitInsertEventListener, org.hibernate.event.spi.PostCommitUpdateEventListener, org.hibernate.event.spi.PostDeleteEventListener, org.hibernate.event.spi.PostInsertEventListener, org.hibernate.event.spi.PostUpdateEventListener

@Component public class AfterCommitListenerImpl extends EventListenerAware<EntityListener> implements AfterCommitListener
Handles the POST_COMMIT_* events of hibernate. Maps hibernate's PostCommitInsertEventListener, PostCommitUpdateEventListener and PostCommitDeleteEventListener to nice EntityListener
See Also:
  • Constructor Details

    • AfterCommitListenerImpl

      public AfterCommitListenerImpl(@Lazy SessionFactoryManager sessionFactoryManager)
  • Method Details

    • onPostInsertCommitFailed

      public void onPostInsertCommitFailed(org.hibernate.event.spi.PostInsertEvent event)
      Specified by:
      onPostInsertCommitFailed in interface org.hibernate.event.spi.PostCommitInsertEventListener
    • onPostUpdateCommitFailed

      public void onPostUpdateCommitFailed(org.hibernate.event.spi.PostUpdateEvent event)
      Specified by:
      onPostUpdateCommitFailed in interface org.hibernate.event.spi.PostCommitUpdateEventListener
    • onPostDeleteCommitFailed

      public void onPostDeleteCommitFailed(org.hibernate.event.spi.PostDeleteEvent event)
      Specified by:
      onPostDeleteCommitFailed in interface org.hibernate.event.spi.PostCommitDeleteEventListener
    • onPostInsert

      public void onPostInsert(org.hibernate.event.spi.PostInsertEvent event)
      Specified by:
      onPostInsert in interface org.hibernate.event.spi.PostInsertEventListener
    • onPostUpdate

      public void onPostUpdate(org.hibernate.event.spi.PostUpdateEvent event)
      Specified by:
      onPostUpdate in interface org.hibernate.event.spi.PostUpdateEventListener
    • onPostDelete

      public void onPostDelete(org.hibernate.event.spi.PostDeleteEvent event)
      Specified by:
      onPostDelete in interface org.hibernate.event.spi.PostDeleteEventListener
    • requiresPostCommitHanding

      public boolean requiresPostCommitHanding(org.hibernate.persister.entity.EntityPersister persister)
    • registerEntityUpdatedEvent

      public void registerEntityUpdatedEvent(List<Entity> entities)
      Description copied from interface: AfterCommitListener
      Register an EntityListener.entityUpdated(EntityEvent) for the given entities. The event will not be fired immediately but only after the transaction was committed successfully.
      Specified by:
      registerEntityUpdatedEvent in interface AfterCommitListener
    • registerEntityDeletedEvent

      public void registerEntityDeletedEvent(List<Entity> entities)
      Description copied from interface: AfterCommitListener
      Register an EntityListener.entityDeleted(EntityEvent) for the given entities. The event will not be fired immediately but only after the transaction was committed successfully.
      Specified by:
      registerEntityDeletedEvent in interface AfterCommitListener
    • listenersFromEntityManager

      protected List<EntityListener> listenersFromEntityManager(PojoEntityManager entityManager)
      Specified by:
      listenersFromEntityManager in class EventListenerAware<EntityListener>
    • requiresPostCommitHandling

      default boolean requiresPostCommitHandling(org.hibernate.persister.entity.EntityPersister arg0)