Class UUIDGeneratingEntityEventListener

  • All Implemented Interfaces:
    io.micronaut.core.order.Ordered, EntityEventListener<java.lang.Object>, java.util.EventListener

    @Singleton
    public class UUIDGeneratingEntityEventListener
    extends AutoPopulatedEntityEventListener
    Supports generating UUIDs.
    Since:
    2.3.0
    Author:
    graemerocher
    • Constructor Detail

      • UUIDGeneratingEntityEventListener

        public UUIDGeneratingEntityEventListener()
    • Method Detail

      • getEventTypes

        @NonNull
        protected final java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> getEventTypes()
        Specified by:
        getEventTypes in class AutoPopulatedEntityEventListener
        Returns:
        The event type
      • prePersist

        public boolean prePersist​(@NonNull
                                  EntityEventContext<java.lang.Object> context)
        Description copied from interface: EntityEventListener
        A pre-persist hook. Implementors can return false to evict the operation.
        Parameters:
        context - The context object
        Returns:
        A boolean value indicating whether to proceed with the operation.