Class VersionGeneratingEntityEventListener

    • Method Detail

      • supports

        public boolean supports​(RuntimePersistentEntity<java.lang.Object> 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 interface EntityEventListener<java.lang.Object>
        Parameters:
        entity - The entity
        eventType - The event type
        Returns:
        True if it is supported
      • 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.
        Specified by:
        prePersist in interface EntityEventListener<java.lang.Object>
        Parameters:
        context - The context object
        Returns:
        A boolean value indicating whether to proceed with the operation.
      • preUpdate

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

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

        @NonNull
        public java.lang.Object populate​(RuntimePersistentProperty<?> property,
                                         @Nullable
                                         java.lang.Object previousValue)
        Description copied from interface: PropertyAutoPopulator
        Auto-populating the property.
        Specified by:
        populate in interface PropertyAutoPopulator<Version>
        Parameters:
        property - the property to auto-populate
        previousValue - the previous value, if any
        Returns:
        new value