Class JpaQueryMethod

java.lang.Object
org.springframework.data.repository.query.QueryMethod
org.springframework.data.jpa.repository.query.JpaQueryMethod

public class JpaQueryMethod extends org.springframework.data.repository.query.QueryMethod
JPA specific extension of QueryMethod.
Author:
Oliver Gierke, Thomas Darimont, Christoph Strobl, Nicolas Cirigliano, Mark Paluch, Сергей Цыпанов, Réda Housni Alaoui, Greg Turnquist
  • Constructor Details

    • JpaQueryMethod

      protected JpaQueryMethod(Method method, org.springframework.data.repository.core.RepositoryMetadata metadata, org.springframework.data.projection.ProjectionFactory factory, QueryExtractor extractor)
      Creates a JpaQueryMethod.
      Parameters:
      method - must not be null
      metadata - must not be null
      factory - must not be null
      extractor - must not be null
  • Method Details

    • getEntityInformation

      public JpaEntityMetadata<?> getEntityInformation()
      Overrides:
      getEntityInformation in class org.springframework.data.repository.query.QueryMethod
    • isModifyingQuery

      public boolean isModifyingQuery()
      Returns whether the finder is a modifying one.
      Overrides:
      isModifyingQuery in class org.springframework.data.repository.query.QueryMethod
      Returns:
    • hasQueryMetaAttributes

      public boolean hasQueryMetaAttributes()
      Returns:
      return true if Meta annotation is available.
      Since:
      3.0
    • getQueryMetaAttributes

      public Meta getQueryMetaAttributes()
      Returns the Meta attributes to be applied.
      Returns:
      never null.
      Since:
      1.6
    • getAnnotatedQuery

      @Nullable public String getAnnotatedQuery()
      Returns the query string declared in a Query annotation or null if neither the annotation found nor the attribute was specified.
      Returns:
    • getRequiredAnnotatedQuery

      public String getRequiredAnnotatedQuery() throws IllegalStateException
      Returns the required query string declared in a Query annotation or throws IllegalStateException if neither the annotation found nor the attribute was specified.
      Returns:
      Throws:
      IllegalStateException - if no Query annotation is present or the query is empty.
      Since:
      2.0
    • getCountQuery

      @Nullable public String getCountQuery()
      Returns the countQuery string declared in a Query annotation or null if neither the annotation found nor the attribute was specified.
      Returns:
    • getNamedQueryName

      public String getNamedQueryName()
      Overrides:
      getNamedQueryName in class org.springframework.data.repository.query.QueryMethod
    • createParameters

      protected JpaParameters createParameters(Method method)
      Overrides:
      createParameters in class org.springframework.data.repository.query.QueryMethod
    • getParameters

      public JpaParameters getParameters()
      Overrides:
      getParameters in class org.springframework.data.repository.query.QueryMethod
    • isCollectionQuery

      public boolean isCollectionQuery()
      Overrides:
      isCollectionQuery in class org.springframework.data.repository.query.QueryMethod
    • isProcedureQuery

      public boolean isProcedureQuery()
      Return true if the method contains a Procedure annotation.
      Returns:
    • getQueryRewriter

      public Class<? extends QueryRewriter> getQueryRewriter()
      Returns the QueryRewriter type.
      Returns:
      type of the QueryRewriter
      Since:
      3.0