Class DefaultReactiveResolveNaturalIdEventListener

  • All Implemented Interfaces:
    java.io.Serializable, org.hibernate.event.spi.ResolveNaturalIdEventListener, ReactiveResolveNaturalIdEventListener

    public class DefaultReactiveResolveNaturalIdEventListener
    extends org.hibernate.event.internal.AbstractLockUpgradeEventListener
    implements ReactiveResolveNaturalIdEventListener, org.hibernate.event.spi.ResolveNaturalIdEventListener
    A reactific DefaultResolveNaturalIdEventListener.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.concurrent.CompletionStage<java.io.Serializable> loadFromDatasource​(org.hibernate.event.spi.ResolveNaturalIdEvent event)
      Performs the process of loading an entity from the configured underlying datasource.
      void onResolveNaturalId​(org.hibernate.event.spi.ResolveNaturalIdEvent event)  
      java.util.concurrent.CompletionStage<java.lang.Void> reactiveResolveNaturalId​(org.hibernate.event.spi.ResolveNaturalIdEvent event)
      Handle the given resolve natural id event.
      protected java.io.Serializable resolveFromCache​(org.hibernate.event.spi.ResolveNaturalIdEvent event)
      Attempts to resolve the entity id corresponding to the event's natural id values from the session
      protected java.util.concurrent.CompletionStage<java.io.Serializable> resolveNaturalId​(org.hibernate.event.spi.ResolveNaturalIdEvent event)
      Coordinates the efforts to load a given entity.
      • Methods inherited from class org.hibernate.event.internal.AbstractLockUpgradeEventListener

        upgradeLock
      • Methods inherited from class org.hibernate.event.internal.AbstractReassociateEventListener

        reassociate
      • Methods inherited from class java.lang.Object

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

      • DefaultReactiveResolveNaturalIdEventListener

        public DefaultReactiveResolveNaturalIdEventListener()
    • Method Detail

      • onResolveNaturalId

        public void onResolveNaturalId​(org.hibernate.event.spi.ResolveNaturalIdEvent event)
                                throws org.hibernate.HibernateException
        Specified by:
        onResolveNaturalId in interface org.hibernate.event.spi.ResolveNaturalIdEventListener
        Throws:
        org.hibernate.HibernateException
      • reactiveResolveNaturalId

        public java.util.concurrent.CompletionStage<java.lang.Void> reactiveResolveNaturalId​(org.hibernate.event.spi.ResolveNaturalIdEvent event)
                                                                                      throws org.hibernate.HibernateException
        Description copied from interface: ReactiveResolveNaturalIdEventListener
        Handle the given resolve natural id event.
        Specified by:
        reactiveResolveNaturalId in interface ReactiveResolveNaturalIdEventListener
        Parameters:
        event - The resolve natural id event to be handled.
        Throws:
        org.hibernate.HibernateException - Indicates a problem resolving natural id to primary key
      • resolveNaturalId

        protected java.util.concurrent.CompletionStage<java.io.Serializable> resolveNaturalId​(org.hibernate.event.spi.ResolveNaturalIdEvent event)
        Coordinates the efforts to load a given entity. First, an attempt is made to load the entity from the session-level cache. If not found there, an attempt is made to locate it in second-level cache. Lastly, an attempt is made to load it directly from the datasource.
        Parameters:
        event - The load event
        Returns:
        The loaded entity, or null.
      • resolveFromCache

        protected java.io.Serializable resolveFromCache​(org.hibernate.event.spi.ResolveNaturalIdEvent event)
        Attempts to resolve the entity id corresponding to the event's natural id values from the session
        Parameters:
        event - The load event
        Returns:
        The entity from the cache, or null.
      • loadFromDatasource

        protected java.util.concurrent.CompletionStage<java.io.Serializable> loadFromDatasource​(org.hibernate.event.spi.ResolveNaturalIdEvent event)
        Performs the process of loading an entity from the configured underlying datasource.
        Parameters:
        event - The load event
        Returns:
        The object loaded from the datasource, or null if not found.