Class AutoPopulatedEntityEventListener
- java.lang.Object
-
- io.micronaut.data.runtime.event.listeners.AutoPopulatedEntityEventListener
-
- All Implemented Interfaces:
io.micronaut.core.order.Ordered,io.micronaut.data.event.EntityEventListener<java.lang.Object>,java.util.EventListener
- Direct Known Subclasses:
AutoTimestampEntityEventListener,UUIDGeneratingEntityEventListener
public abstract class AutoPopulatedEntityEventListener extends java.lang.Object implements io.micronaut.data.event.EntityEventListener<java.lang.Object>Abstract implementation of a listener that handlesAutoPopulated.- Since:
- 2.3.0
-
-
Constructor Summary
Constructors Constructor Description AutoPopulatedEntityEventListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected io.micronaut.data.model.runtime.RuntimePersistentProperty<java.lang.Object>[]getApplicableProperties(io.micronaut.data.model.runtime.RuntimePersistentEntity<java.lang.Object> entity)Returns the applicable properties for this listener.protected abstract java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>>getEventTypes()protected abstract java.util.function.Predicate<io.micronaut.data.model.runtime.RuntimePersistentProperty<java.lang.Object>>getPropertyPredicate()booleansupports(io.micronaut.data.model.runtime.RuntimePersistentEntity<java.lang.Object> entity, java.lang.Class<? extends java.lang.annotation.Annotation> eventType)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
supports
public final boolean supports(io.micronaut.data.model.runtime.RuntimePersistentEntity<java.lang.Object> entity, java.lang.Class<? extends java.lang.annotation.Annotation> eventType)- Specified by:
supportsin interfaceio.micronaut.data.event.EntityEventListener<java.lang.Object>
-
getEventTypes
@NonNull protected abstract java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> getEventTypes()
- Returns:
- The event type
-
getPropertyPredicate
@NonNull protected abstract java.util.function.Predicate<io.micronaut.data.model.runtime.RuntimePersistentProperty<java.lang.Object>> getPropertyPredicate()
- Returns:
- A predicate to apply for the given property.
-
getApplicableProperties
@NonNull protected io.micronaut.data.model.runtime.RuntimePersistentProperty<java.lang.Object>[] getApplicableProperties(io.micronaut.data.model.runtime.RuntimePersistentEntity<java.lang.Object> entity)
Returns the applicable properties for this listener.- Parameters:
entity- The entity- Returns:
- the properties
-
-