Class SimpleRepositoryMethodHqlQueryHandler

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

public class SimpleRepositoryMethodHqlQueryHandler extends Object implements SimpleRepositoryMethodHandler
Implementation of SimpleRepositoryMethodHandler for handling methods annotated with Query. This handler executes BQL (Bibernate Query Language) queries.
Since:
1.0
Author:
Blyzhnytsia Team
  • Constructor Details

    • SimpleRepositoryMethodHqlQueryHandler

      public SimpleRepositoryMethodHqlQueryHandler()
  • Method Details

    • isMethodHandle

      public boolean isMethodHandle(Method method)
      Checks if the given method can be handled by this handler. Checks if the method is annotated with Query, specifies HQL, and is not a native query.
      Specified by:
      isMethodHandle in interface SimpleRepositoryMethodHandler
      Parameters:
      method - The method to check.
      Returns:
      true if this handler can handle the method, false otherwise.
    • execute

      public Object execute(Method method, Object[] parameters, RepositoryDetails repositoryDetails, MethodMetadata methodMetadata)
      Executes the given repository method using the provided parameters, repository details, and method metadata. Executes the HQL query specified in the Query annotation.
      Specified by:
      execute in interface SimpleRepositoryMethodHandler
      Parameters:
      method - The repository method to execute.
      parameters - The parameters for the 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 repository method execution.