Interface PrePersistEventListener<T>
- Type Parameters:
T- The entity type
- All Superinterfaces:
EntityEventListener<T>,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.
Functional version or
PrePersist event handlers.- Since:
- 2.3.0
-
Field Summary
Fields inherited from interface io.micronaut.data.event.EntityEventListener
NOOPFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanprePersist(@NonNull EntityEventContext<T> context) A pre-persist hook.booleanprePersist(T entity) A pre-persist hook.default booleansupports(RuntimePersistentEntity<T> entity, Class<? extends 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, preQuery, preRemove, preUpdateMethods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Method Details
-
prePersist
A pre-persist hook. Implementors can return false to evict the operation.- Parameters:
entity- The entity- Returns:
- A boolean value indicating whether to proceed with the operation.
-
prePersist
Description copied from interface:EntityEventListenerA pre-persist hook. Implementors can return false to evict the operation.- Specified by:
prePersistin interfaceEntityEventListener<T>- Parameters:
context- The context object- Returns:
- A boolean value indicating whether to proceed with the operation.
-
supports
Description copied from interface:EntityEventListenerAllows including or excluding a listener for a specific entity.- Specified by:
supportsin interfaceEntityEventListener<T>- Parameters:
entity- The entityeventType- The event type- Returns:
- True if it is supported
-