Class DefaultReactiveResolveNaturalIdEventListener
- java.lang.Object
-
- org.hibernate.event.internal.AbstractReassociateEventListener
-
- org.hibernate.event.internal.AbstractLockUpgradeEventListener
-
- org.hibernate.reactive.event.impl.DefaultReactiveResolveNaturalIdEventListener
-
- All Implemented Interfaces:
org.hibernate.event.spi.ResolveNaturalIdEventListener
,ReactiveResolveNaturalIdEventListener
public class DefaultReactiveResolveNaturalIdEventListener extends org.hibernate.event.internal.AbstractLockUpgradeEventListener implements ReactiveResolveNaturalIdEventListener, org.hibernate.event.spi.ResolveNaturalIdEventListener
A reactificDefaultResolveNaturalIdEventListener
.
-
-
Constructor Summary
Constructors Constructor Description DefaultReactiveResolveNaturalIdEventListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.concurrent.CompletionStage<java.lang.Object>
loadFromDatasource(org.hibernate.event.spi.ResolveNaturalIdEvent event)
Performs the process of loading an entity from the configured underlying datasource.java.util.concurrent.CompletionStage<java.lang.Void>
onReactiveResolveNaturalId(org.hibernate.event.spi.ResolveNaturalIdEvent event)
Handle the given resolve natural id event.void
onResolveNaturalId(org.hibernate.event.spi.ResolveNaturalIdEvent event)
protected java.lang.Object
resolveFromCache(org.hibernate.event.spi.ResolveNaturalIdEvent event)
Attempts to resolve the entity id corresponding to the event's natural id values from the sessionprotected java.util.concurrent.CompletionStage<java.lang.Object>
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
-
-
-
-
Method Detail
-
onResolveNaturalId
public void onResolveNaturalId(org.hibernate.event.spi.ResolveNaturalIdEvent event) throws org.hibernate.HibernateException
- Specified by:
onResolveNaturalId
in interfaceorg.hibernate.event.spi.ResolveNaturalIdEventListener
- Throws:
org.hibernate.HibernateException
-
onReactiveResolveNaturalId
public java.util.concurrent.CompletionStage<java.lang.Void> onReactiveResolveNaturalId(org.hibernate.event.spi.ResolveNaturalIdEvent event) throws org.hibernate.HibernateException
Description copied from interface:ReactiveResolveNaturalIdEventListener
Handle the given resolve natural id event.- Specified by:
onReactiveResolveNaturalId
in interfaceReactiveResolveNaturalIdEventListener
- Parameters:
event
- The resolve natural id event to be handled.- Throws:
org.hibernate.HibernateException
-
resolveNaturalId
protected java.util.concurrent.CompletionStage<java.lang.Object> 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.lang.Object 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.lang.Object> 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.
-
-