Class DefaultReactiveFlushEntityEventListener

  • All Implemented Interfaces:
    org.hibernate.event.spi.FlushEntityEventListener, org.hibernate.jpa.event.spi.CallbackRegistryConsumer

    public class DefaultReactiveFlushEntityEventListener
    extends java.lang.Object
    implements org.hibernate.event.spi.FlushEntityEventListener, org.hibernate.jpa.event.spi.CallbackRegistryConsumer
    A reactific DefaultFlushEntityEventListener. This implementation is almost, but not quite, a line-for-line copy of DefaultFlushEntityEventListener. The only difference is that it creates ReactiveEntityUpdateActions. Unlike other event listeners in this package, this listener's onFlushEntity(FlushEntityEvent) method does not need to by called in a non-blocking manner, and so therefore there is no ReactiveFlushEntityEventListener interface.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static Log LOG  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkId​(java.lang.Object object, org.hibernate.persister.entity.EntityPersister persister, java.lang.Object id, org.hibernate.engine.spi.SessionImplementor session)
      make sure user didn't mangle the id
      protected void dirtyCheck​(org.hibernate.event.spi.FlushEntityEvent event)
      Perform a dirty check, and attach the results to the event
      protected boolean handleInterception​(org.hibernate.event.spi.FlushEntityEvent event)  
      void injectCallbackRegistry​(org.hibernate.jpa.event.spi.CallbackRegistry callbackRegistry)  
      protected boolean invokeInterceptor​(org.hibernate.event.spi.FlushEntityEvent event)  
      protected boolean isUpdateNecessary​(org.hibernate.event.spi.FlushEntityEvent event)
      Performs all necessary checking to determine if an entity needs an SQL update to synchronize its state to the database.
      void onFlushEntity​(org.hibernate.event.spi.FlushEntityEvent event)
      Flushes a single entity's state to the database, by scheduling an update action, if necessary
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        protected static final Log LOG
    • Constructor Detail

      • DefaultReactiveFlushEntityEventListener

        public DefaultReactiveFlushEntityEventListener()
    • Method Detail

      • injectCallbackRegistry

        public void injectCallbackRegistry​(org.hibernate.jpa.event.spi.CallbackRegistry callbackRegistry)
        Specified by:
        injectCallbackRegistry in interface org.hibernate.jpa.event.spi.CallbackRegistryConsumer
      • checkId

        public void checkId​(java.lang.Object object,
                            org.hibernate.persister.entity.EntityPersister persister,
                            java.lang.Object id,
                            org.hibernate.engine.spi.SessionImplementor session)
                     throws org.hibernate.HibernateException
        make sure user didn't mangle the id
        Throws:
        org.hibernate.HibernateException
      • onFlushEntity

        public void onFlushEntity​(org.hibernate.event.spi.FlushEntityEvent event)
                           throws org.hibernate.HibernateException
        Flushes a single entity's state to the database, by scheduling an update action, if necessary
        Specified by:
        onFlushEntity in interface org.hibernate.event.spi.FlushEntityEventListener
        Throws:
        org.hibernate.HibernateException
      • handleInterception

        protected boolean handleInterception​(org.hibernate.event.spi.FlushEntityEvent event)
      • invokeInterceptor

        protected boolean invokeInterceptor​(org.hibernate.event.spi.FlushEntityEvent event)
      • isUpdateNecessary

        protected final boolean isUpdateNecessary​(org.hibernate.event.spi.FlushEntityEvent event)
                                           throws org.hibernate.HibernateException
        Performs all necessary checking to determine if an entity needs an SQL update to synchronize its state to the database. Modifies the event by side-effect! Note: this method is quite slow, avoid calling if possible!
        Throws:
        org.hibernate.HibernateException
      • dirtyCheck

        protected void dirtyCheck​(org.hibernate.event.spi.FlushEntityEvent event)
                           throws org.hibernate.HibernateException
        Perform a dirty check, and attach the results to the event
        Throws:
        org.hibernate.HibernateException