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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringMessage indicating that the deleteAll method should have one parameter List.private static final StringThe name of the handled method (deleteAll).Fields inherited from interface io.github.blyznytsiaorg.bibernate.dao.method.handler.SimpleRepositoryMethodHandler
CANNOT_FIND_RESULT_FOR_S_IN_METHOD_S, CANNOT_RETURN_S_SHOULD_BE_OPTIONAL_S_OR_S, EXPECTED_SINGLE_RESULT, HANDLE_METHOD, LOOKS_LIKE_METHOD_WITHOUT_REQUIRED_PARAMETER_ID, NOT_SUPPORTED_RETURN_TYPE_FOR_METHOD_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(Method method, Object[] parameters, RepositoryDetails repositoryDetails, MethodMetadata methodMetadata) Executes the deleteAll method in the simple repository.private <T> voidexecuteHelper(Class<T> entityClass, Collection entities, BibernateSession bringSession) booleanisMethodHandle(Method method) Checks if the given method is the deleteAll method.
-
Field Details
-
METHOD_NAME
The name of the handled method (deleteAll).- See Also:
-
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
Checks if the given method is the deleteAll method.- Specified by:
isMethodHandlein interfaceSimpleRepositoryMethodHandler- Parameters:
method- The method to check.- Returns:
trueif the method is deleteAll,falseotherwise.
-
execute
public Object execute(Method method, Object[] parameters, RepositoryDetails repositoryDetails, MethodMetadata methodMetadata) Executes the deleteAll method in the simple repository.- Specified by:
executein interfaceSimpleRepositoryMethodHandler- 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)
-