Class SimpleRepositoryMethodDeleteAllHandler

java.lang.Object
io.github.blyznytsiaorg.bibernate.dao.method.handler.SimpleRepositoryMethodDeleteAllHandler
All Implemented Interfaces:
SimpleRepositoryMethodHandler

public class SimpleRepositoryMethodDeleteAllHandler extends Object implements SimpleRepositoryMethodHandler
Handler for executing the deleteAll method in a simple repository. Implements the SimpleRepositoryMethodHandler interface.
Since:
1.0
Author:
Blyzhnytsia Team
  • Field Details

    • METHOD_NAME

      private static final String METHOD_NAME
      The name of the handled method (deleteAll).
      See Also:
    • DELETE_METHOD_SHOULD_HAVE_ONE_PARAMETER_ID

      private static final String DELETE_METHOD_SHOULD_HAVE_ONE_PARAMETER_ID
      Message indicating that the deleteAll method should have one parameter List.
      See Also:
  • Constructor Details

    • SimpleRepositoryMethodDeleteAllHandler

      public SimpleRepositoryMethodDeleteAllHandler()
  • Method Details

    • isMethodHandle

      public boolean isMethodHandle(Method method)
      Checks if the given method is the deleteAll method.
      Specified by:
      isMethodHandle in interface SimpleRepositoryMethodHandler
      Parameters:
      method - The method to check.
      Returns:
      true if the method is deleteAll, false otherwise.
    • execute

      public Object execute(Method method, Object[] parameters, RepositoryDetails repositoryDetails, MethodMetadata methodMetadata)
      Executes the deleteAll method in the simple repository.
      Specified by:
      execute in interface SimpleRepositoryMethodHandler
      Parameters:
      method - The deleteAll method to execute.
      parameters - The parameters for the deleteAll method invocation.
      repositoryDetails - Details about the repository, including its name, primary key type, entity type, etc.
      methodMetadata - Metadata for the repository method, including its name, return type, and parameters.
      Returns:
      The result of the deleteAll method execution, which is always Void.TYPE.
    • executeHelper

      private <T> void executeHelper(Class<T> entityClass, Collection entities, BibernateSession bringSession)