Class EventSupport
java.lang.Object
org.springframework.data.neo4j.core.mapping.callback.EventSupport
Utility class that orchestrates
EntityCallbacks. Not to be used outside the
framework.- Since:
- 6.0.2
- Author:
- Michael J. Simons
-
Method Summary
Modifier and TypeMethodDescriptionstatic EventSupportdiscoverCallbacks(Neo4jMappingContext context, BeanFactory beanFactory) Creates event support containing the required default events plus all entity callbacks discoverable through theBeanFactory.<T> TmaybeCallAfterConvert(T object, Neo4jPersistentEntity<T> entity, org.neo4j.driver.types.MapAccessor source) Will be called after any conversion.<T> TmaybeCallBeforeBind(T object) static EventSupportuseExistingCallbacks(Neo4jMappingContext context, EntityCallbacks entityCallbacks) Creates event support containing the required default events plus all explicitly defined events.
-
Method Details
-
discoverCallbacks
Creates event support containing the required default events plus all entity callbacks discoverable through theBeanFactory.- Parameters:
context- the mapping context that is used in some of the callbacksbeanFactory- the bean factory used to discover additional callbacks- Returns:
- a new instance of the event support
-
useExistingCallbacks
public static EventSupport useExistingCallbacks(Neo4jMappingContext context, EntityCallbacks entityCallbacks) Creates event support containing the required default events plus all explicitly defined events.- Parameters:
context- the mapping context that is used in some of the callbacksentityCallbacks- predefined callbacks.- Returns:
- a new instance of the event support
-
maybeCallBeforeBind
public <T> T maybeCallBeforeBind(T object) -
maybeCallAfterConvert
public <T> T maybeCallAfterConvert(T object, Neo4jPersistentEntity<T> entity, org.neo4j.driver.types.MapAccessor source) Will be called after any conversion.- Type Parameters:
T- the expected type- Parameters:
object- the freshly converted instanceentity- the entitysource- the source of the instance- Returns:
- the instance to which the callback was applied to
-