Top Description Inners Fields Constructors Methods
org.hibernate.jpa.event.internal

pack-priv final Class CallbackRegistryImpl

extends Object
implements CallbackRegistry
Class Inheritance
All Implemented Interfaces
org.hibernate.jpa.event.spi.CallbackRegistry
Imports
java.util.HashMap, .Map, jakarta.persistence.PersistenceException, org.hibernate.internal.util.collections.ArrayHelper, .MapBackedClassValue, .ReadOnlyMap, org.hibernate.jpa.event.spi.Callback, .CallbackRegistry, .CallbackType

Keep track of all lifecycle callbacks and listeners for a given persistence unit
Authors
Kabir Khan, Steve Ebersole, Sanne Grinovero

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final ReadOnlyMap<Class<T>, Callback[]>
private final ReadOnlyMap<Class<T>, Callback[]>
private final ReadOnlyMap<Class<T>, Callback[]>
private final ReadOnlyMap<Class<T>, Callback[]>
private final ReadOnlyMap<Class<T>, Callback[]>
private final ReadOnlyMap<Class<T>, Callback[]>
private final ReadOnlyMap<Class<T>, Callback[]>

Constructor Summary

AccessConstructor and Description
public
CallbackRegistryImpl(Map<Class<?>, Callback[]> preCreates, Map<Class<?>, Callback[]> postCreates, Map<Class<?>, Callback[]> preRemoves, Map<Class<?>, Callback[]> postRemoves, Map<Class<?>, Callback[]> preUpdates, Map<Class<?>, Callback[]> postUpdates, Map<Class<?>, Callback[]> postLoads)

Method Summary

Modifier and TypeMethod and Description
private boolean
callback(Callback[] callbacks, Object bean)

private static ReadOnlyMap<Class<T>, Callback[]>
createBackingMap(final Map<Class<?>, Callback[]> src)

private ReadOnlyMap<Class<T>, Callback[]>
public boolean
hasRegisteredCallbacks(Class<?>
The entity Class to check against
entityClass
,
CallbackType
The type of callback to look for
callbackType
)

Implements org.hibernate.jpa.event.spi.CallbackRegistry.hasRegisteredCallbacks.

Do we have any registered callbacks of the given type for the given entity?
private boolean
notEmpty(Callback[] callbacks)

public void
public boolean
public void
public void
public void
public void
public boolean
public void
release()

Implements org.hibernate.jpa.event.spi.CallbackRegistry.release.

Signals that the CallbackRegistry will no longer be used.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

postCreatesback to summary
private final ReadOnlyMap<Class<T>, Callback[]> postCreates
postLoadsback to summary
private final ReadOnlyMap<Class<T>, Callback[]> postLoads
postRemovesback to summary
private final ReadOnlyMap<Class<T>, Callback[]> postRemoves
postUpdatesback to summary
private final ReadOnlyMap<Class<T>, Callback[]> postUpdates
preCreatesback to summary
private final ReadOnlyMap<Class<T>, Callback[]> preCreates
preRemovesback to summary
private final ReadOnlyMap<Class<T>, Callback[]> preRemoves
preUpdatesback to summary
private final ReadOnlyMap<Class<T>, Callback[]> preUpdates

Constructor Detail

CallbackRegistryImplback to summary
public CallbackRegistryImpl(Map<Class<?>, Callback[]> preCreates, Map<Class<?>, Callback[]> postCreates, Map<Class<?>, Callback[]> preRemoves, Map<Class<?>, Callback[]> postRemoves, Map<Class<?>, Callback[]> preUpdates, Map<Class<?>, Callback[]> postUpdates, Map<Class<?>, Callback[]> postLoads)

Method Detail

callbackback to summary
private boolean callback(Callback[] callbacks, Object bean)
createBackingMapback to summary
private static ReadOnlyMap<Class<T>, Callback[]> createBackingMap(final Map<Class<?>, Callback[]> src)
determineAppropriateCallbackMapback to summary
private ReadOnlyMap<Class<T>, Callback[]> determineAppropriateCallbackMap(CallbackType callbackType)
hasRegisteredCallbacksback to summary
public boolean hasRegisteredCallbacks(Class<?> entityClass, CallbackType callbackType)

Implements org.hibernate.jpa.event.spi.CallbackRegistry.hasRegisteredCallbacks.

Doc from org.hibernate.jpa.event.spi.CallbackRegistry.hasRegisteredCallbacks.

Do we have any registered callbacks of the given type for the given entity?

Parameters
entityClass:Class<?>

The entity Class to check against

callbackType:CallbackType

The type of callback to look for

Returns:boolean

true indicates there are already registered callbacks of that type for that class; false indicates there are not.

Annotations
@Override
notEmptyback to summary
private boolean notEmpty(Callback[] callbacks)
postCreateback to summary
public void postCreate(Object bean)

Implements org.hibernate.jpa.event.spi.CallbackRegistry.postCreate.

Annotations
@Override
postLoadback to summary
public boolean postLoad(Object bean)

Implements org.hibernate.jpa.event.spi.CallbackRegistry.postLoad.

Annotations
@Override
postRemoveback to summary
public void postRemove(Object bean)

Implements org.hibernate.jpa.event.spi.CallbackRegistry.postRemove.

Annotations
@Override
postUpdateback to summary
public void postUpdate(Object bean)

Implements org.hibernate.jpa.event.spi.CallbackRegistry.postUpdate.

Annotations
@Override
preCreateback to summary
public void preCreate(Object bean)

Implements org.hibernate.jpa.event.spi.CallbackRegistry.preCreate.

Annotations
@Override
preRemoveback to summary
public void preRemove(Object bean)

Implements org.hibernate.jpa.event.spi.CallbackRegistry.preRemove.

Annotations
@Override
preUpdateback to summary
public boolean preUpdate(Object bean)

Implements org.hibernate.jpa.event.spi.CallbackRegistry.preUpdate.

Annotations
@Override
releaseback to summary
public void release()

Implements org.hibernate.jpa.event.spi.CallbackRegistry.release.

Doc from org.hibernate.jpa.event.spi.CallbackRegistry.release.

Signals that the CallbackRegistry will no longer be used. In particular, it is important to release references to class types to avoid classloader leaks.

Annotations
@Override
org.hibernate.jpa.event.internal back to summary

public Class CallbackRegistryImpl.Builder

extends Object
Class Inheritance
  • java.lang.Object
  • org.hibernate.jpa.event.internal.CallbackRegistryImpl.Builder

Field Summary

Modifier and TypeField and Description
private final Map<Class<?>, Callback[]>
private final Map<Class<?>, Callback[]>
private final Map<Class<?>, Callback[]>
private final Map<Class<?>, Callback[]>
private final Map<Class<?>, Callback[]>
private final Map<Class<?>, Callback[]>
private final Map<Class<?>, Callback[]>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected CallbackRegistryImpl
private Map<Class<?>, Callback[]>
public void
registerCallbacks(Class<?> entityClass, Callback[] callbacks)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

postCreatesback to summary
private final Map<Class<?>, Callback[]> postCreates
postLoadsback to summary
private final Map<Class<?>, Callback[]> postLoads
postRemovesback to summary
private final Map<Class<?>, Callback[]> postRemoves
postUpdatesback to summary
private final Map<Class<?>, Callback[]> postUpdates
preCreatesback to summary
private final Map<Class<?>, Callback[]> preCreates
preRemovesback to summary
private final Map<Class<?>, Callback[]> preRemoves
preUpdatesback to summary
private final Map<Class<?>, Callback[]> preUpdates

Constructor Detail

Builderback to summary
public Builder()

Method Detail

buildback to summary
protected CallbackRegistryImpl build()
determineAppropriateCallbackMapback to summary
private Map<Class<?>, Callback[]> determineAppropriateCallbackMap(CallbackType callbackType)
registerCallbacksback to summary
public void registerCallbacks(Class<?> entityClass, Callback[] callbacks)