Interface PreRemoveEventListener<T>
-
- Type Parameters:
T
- The entity type
- All Superinterfaces:
EntityEventListener<T>
,java.util.EventListener
,io.micronaut.core.order.Ordered
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface PreRemoveEventListener<T> extends EntityEventListener<T>
Functional version orPreRemove
event handlers.- Since:
- 2.3.0
-
-
Field Summary
-
Fields inherited from interface io.micronaut.data.event.EntityEventListener
NOOP
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
preRemove(EntityEventContext<T> context)
A pre-remove hook.boolean
preRemove(T entity)
A pre-remove hook.default boolean
supports(RuntimePersistentEntity<T> entity, java.lang.Class<? extends java.lang.annotation.Annotation> eventType)
Allows including or excluding a listener for a specific entity.-
Methods inherited from interface io.micronaut.data.event.EntityEventListener
postLoad, postPersist, postRemove, postUpdate, prePersist, preQuery, preUpdate
-
-
-
-
Method Detail
-
preRemove
boolean preRemove(@NonNull T entity)
A pre-remove hook. Implementors can return false to evict the operation.- Parameters:
entity
- The entity- Returns:
- A boolean value indicating whether to proceed with the operation.
-
preRemove
default boolean preRemove(@NonNull EntityEventContext<T> context)
Description copied from interface:EntityEventListener
A pre-remove hook. Implementors can return false to evict the operation.- Specified by:
preRemove
in interfaceEntityEventListener<T>
- Parameters:
context
- The context object- Returns:
- A boolean value indicating whether to proceed with the operation.
-
supports
default boolean supports(RuntimePersistentEntity<T> entity, java.lang.Class<? extends java.lang.annotation.Annotation> eventType)
Description copied from interface:EntityEventListener
Allows including or excluding a listener for a specific entity.- Specified by:
supports
in interfaceEntityEventListener<T>
- Parameters:
entity
- The entityeventType
- The event type- Returns:
- True if it is supported
-
-