java.lang.Object
org.springframework.data.neo4j.core.mapping.callback.EventSupport

@API(status=INTERNAL, since="6.0.2") public final class EventSupport extends Object
Utility class that orchestrates EntityCallbacks. Not to be used outside the framework.
Since:
6.0.2
Author:
Michael J. Simons
  • Method Details

    • discoverCallbacks

      public static EventSupport discoverCallbacks(Neo4jMappingContext context, BeanFactory beanFactory)
      Creates event support containing the required default events plus all entity callbacks discoverable through the BeanFactory.
      Parameters:
      context - The mapping context that is used in some of the callbacks.
      beanFactory - 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 callbacks.
      entityCallbacks - predefined callbacks.
      Returns:
      A new instance of the event support
    • maybeCallBeforeBind

      @Nullable public <T> T maybeCallBeforeBind(@Nullable T object)
    • maybeCallAfterConvert

      @Nullable public <T> T maybeCallAfterConvert(@Nullable T object, Neo4jPersistentEntity<T> entity, org.neo4j.driver.types.MapAccessor source)
      Type Parameters:
      T - Expected type
      Parameters:
      object - The freshly converted instance
      entity - The entity
      source - The source of the instance
      Returns:
      The instance to which the callback was applied to