Class DeleteAllEntityAction<T>

java.lang.Object
io.github.blyznytsiaorg.bibernate.actionqueue.impl.DeleteAllEntityAction<T>
Type Parameters:
T - The generic type representing the entity class.
All Implemented Interfaces:
EntityAction

public class DeleteAllEntityAction<T> extends Object implements EntityAction
Represents an entity action for bulk deletion of entities of a specific class. This action is associated with a Bibernate session and executes the deletion operation for the provided collection of entities within the specified entity class.
Since:
1.0
Author:
Blyzhnytsia Team
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final BibernateSession
    The Bibernate session associated with the DeleteAllEntityAction, providing access to the underlying data access operations and serving as the execution context for the bulk entity deletion action.
    private final Collection<T>
    The collection of entities to be deleted by this action.
    private final Class<T>
    The class of entities targeted for deletion by this action.
    private final Runnable
    Runnable to remove cache and snapshot.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Executes the bulk entity deletion action by invoking the corresponding method in the associated Bibernate session.
    Retrieves the ActionType associated with this entity action, indicating the type of operation (DELETE).
    Retrieves the collection of entities targeted for deletion by this action.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.github.blyznytsiaorg.bibernate.actionqueue.EntityAction

    getEntityClass
  • Field Details

    • bibernateSession

      private final BibernateSession bibernateSession
      The Bibernate session associated with the DeleteAllEntityAction, providing access to the underlying data access operations and serving as the execution context for the bulk entity deletion action.
    • entityClass

      private final Class<T> entityClass
      The class of entities targeted for deletion by this action.
    • entities

      private final Collection<T> entities
      The collection of entities to be deleted by this action.
    • removeCacheAndSnapshot

      private final Runnable removeCacheAndSnapshot
      Runnable to remove cache and snapshot.
  • Constructor Details

    • DeleteAllEntityAction

      public DeleteAllEntityAction()
  • Method Details

    • execute

      public void execute()
      Executes the bulk entity deletion action by invoking the corresponding method in the associated Bibernate session. This method checks for a non-empty collection of entities before performing the deletion operation.
      Specified by:
      execute in interface EntityAction
    • getEntities

      public Collection<T> getEntities()
      Retrieves the collection of entities targeted for deletion by this action.
      Specified by:
      getEntities in interface EntityAction
      Returns:
      The collection of entities.
    • getActionType

      public ActionType getActionType()
      Retrieves the ActionType associated with this entity action, indicating the type of operation (DELETE).
      Specified by:
      getActionType in interface EntityAction
      Returns:
      The ActionType associated with this entity action.