Class JdbcQueryMethod

java.lang.Object
org.springframework.data.repository.query.QueryMethod
org.springframework.data.jdbc.repository.query.JdbcQueryMethod

public class JdbcQueryMethod extends QueryMethod
QueryMethod implementation that implements a method by executing the query from a Query annotation on that method. Binds method arguments to named parameters in the SQL statement.
Author:
Jens Schauder, Kazuki Shimizu, Moises Cisneros, Hebert Coelho, Diego Krupitza, Mark Paluch
  • Constructor Details

    • JdbcQueryMethod

      public JdbcQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory factory, NamedQueries namedQueries, MappingContext<? extends org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?>,? extends org.springframework.data.relational.core.mapping.RelationalPersistentProperty> mappingContext)
  • Method Details

    • createParameters

      protected Parameters<?,?> createParameters(ParametersSource parametersSource)
      Overrides:
      createParameters in class QueryMethod
    • getEntityInformation

      public org.springframework.data.relational.repository.query.RelationalEntityMetadata<?> getEntityInformation()
      Overrides:
      getEntityInformation in class QueryMethod
    • getParameters

      public JdbcParameters getParameters()
      Overrides:
      getParameters in class QueryMethod
    • getRequiredQuery

      public String getRequiredQuery()
    • hasAnnotatedQueryName

      public boolean hasAnnotatedQueryName()
      Returns:
      true if the method is annotated with @Query(name=…).
    • getNamedQueryName

      public String getNamedQueryName()
      Overrides:
      getNamedQueryName in class QueryMethod
    • isModifyingQuery

      public boolean isModifyingQuery()
      Returns whether the query method is a modifying one.
      Overrides:
      isModifyingQuery in class QueryMethod
      Returns:
      if it's a modifying query, return true.
    • hasAnnotatedQuery

      public boolean hasAnnotatedQuery()
      Returns:
      true if the method has an annotated query.
    • hasLockMode

      public boolean hasLockMode()
      Returns:
      is a Lock annotation present or not.