Class DeleteByIdEntityAction<T>

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

public class DeleteByIdEntityAction<T> extends Object implements EntityAction
Represents an entity action for deleting entities by their primary key in the Bibernate framework. This action is associated with a specific entity class, a primary key value, and a collection of entities to be deleted.

Upon execution, the action deletes entities with the specified primary key from the data store.

Since:
1.0
Author:
Blyzhnytsia Team
  • Field Details

    • bibernateSession

      private final BibernateSession bibernateSession
      The Bibernate session associated with the DeleteByIdEntityAction, providing access to the underlying data access operations and the execution context for the entity deletion by primary key action.
    • entityClass

      private final Class<T> entityClass
      The Class object representing the type of entities to be deleted.
    • primaryKey

      private final Object primaryKey
      The primary key value used to identify and delete entities.
    • entities

      private final Collection<T> entities
      A collection of entities associated with the delete action.
    • removeCacheAndSnapshot

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

    • DeleteByIdEntityAction

      public DeleteByIdEntityAction()
  • Method Details

    • execute

      public void execute()
      Executes the entity action by deleting entities with the specified primary key from the data store.
      Specified by:
      execute in interface EntityAction
    • getEntities

      public Collection<T> getEntities()
      Gets the collection of entities to be deleted.
      Specified by:
      getEntities in interface EntityAction
      Returns:
      A collection of entities associated with the delete action.
    • getActionType

      public ActionType getActionType()
      Gets the type of action, which is DELETE.
      Specified by:
      getActionType in interface EntityAction
      Returns:
      The ActionType representing the type of entity action.