Class StringBasedGemfireRepositoryQuery

java.lang.Object
org.springframework.data.gemfire.repository.query.GemfireRepositoryQuery
org.springframework.data.gemfire.repository.query.StringBasedGemfireRepositoryQuery
All Implemented Interfaces:
org.springframework.data.repository.query.RepositoryQuery

public class StringBasedGemfireRepositoryQuery extends GemfireRepositoryQuery
GemfireRepositoryQuery using plain String based OQL queries.
See Also:
  • Constructor Details

  • Method Details

    • asDerivedQuery

      @NonNull public StringBasedGemfireRepositoryQuery asDerivedQuery()
      Builder method used to set this RepositoryQuery as derived.
      Returns:
      a boolean value indicating whether the OQL query was derived from the Repository infrastructure QueryMethod name/signature.
      See Also:
    • asUserDefinedQuery

      @NonNull public StringBasedGemfireRepositoryQuery asUserDefinedQuery()
      Builder method used to set this RepositoryQuery as user-defined.
      Returns:
      this RepositoryQuery.
      See Also:
    • isDerivedQuery

      public boolean isDerivedQuery()
      Determines whether the OQL query represented by this RepositoryQuery is derived from the Repository infrastructure QueryMethod name/signature conventions.
      Returns:
      a boolean value indicating if the OQL query represented by this RepositoryQuery is derived.
      See Also:
    • isUserDefinedQuery

      public boolean isUserDefinedQuery()
      Determines whether the OQL query represented by this RepositoryQuery is user-defined or was generated by the Spring Data Repository infrastructure. An OQL query is user-defined if the query was specified using the Query annotation on the Repository QueryMethod or was specified in the <module>-named-queries.properties file. Derived queries are not user-defined.
      Returns:
      a boolean value indicating whether the OQL query represented this RepositoryQuery is user-defined.
      See Also:
    • getNonPagedQueryExecutor

      @NonNull protected OqlQueryExecutor getNonPagedQueryExecutor()
      Returns the configured OqlQueryExecutor (strategy) used to execute Apache Geode non-paged OQL queries.
      Returns:
      the configured OqlQueryExecutor (strategy) used to execute Apache Geode non-paged OQL queries.
      See Also:
    • getPagedQueryExecutor

      @NonNull protected OqlQueryExecutor getPagedQueryExecutor()
      Returns the configured OqlQueryExecutor (strategy) used to execute Apache Geode paged OQL queries.
      Returns:
      the configured OqlQueryExecutor (strategy) used to execute Apache Geode paged OQL queries.
      See Also:
    • getQuery

      @NonNull protected QueryString getQuery()
      Returns a reference to the managed query.
      Returns:
      a reference to the managed query.
      See Also:
    • getTemplate

      @NonNull protected GemfireTemplate getTemplate()
      Returns a reference to the GemfireTemplate used to perform all data access and query operations.
      Returns:
      a reference to the GemfireTemplate used to perform all data access and query operations.
      See Also:
    • execute

      public Object execute(Object[] arguments)
    • prepareQuery

      @NonNull protected String prepareQuery(@NonNull org.springframework.data.repository.query.QueryMethod queryMethod, @NonNull QueryString query, @NonNull Object[] arguments)
      Prepares the OQL query statement to execute.
      Parameters:
      queryMethod - QueryMethod modeling the OQL query.
      query - QueryString containing the OQL query statement.
      arguments - array of Object values containing the arguments for the OQL query bind in parameters.
      Returns:
      the prepared OQL query to execute.
      See Also:
    • resolveOqlQueryExecutor

      @NonNull protected OqlQueryExecutor resolveOqlQueryExecutor(@NonNull org.springframework.data.repository.query.QueryMethod queryMethod)
      Resolves the OqlQueryExecutor used to execute the OQL query statement modeled by the given QueryMethod.
      Parameters:
      queryMethod - QueryMethod used to resolve the OqlQueryExecutor; must not be null.
      Returns:
      the resolve OqlQueryExecutor appropriate for executing the OQL query statement modeled by the give QueryMethod.
      See Also:
    • processQueryResults

      @Nullable protected Object processQueryResults(@NonNull org.springframework.data.repository.query.QueryMethod queryMethod, @NonNull org.apache.geode.cache.query.SelectResults<?> selectResults, @NonNull Object... arguments)
      Processes the OQL query result set.
      Parameters:
      queryMethod - QueryMethod modeling the OQL query.
      selectResults - SelectResults from the execution of the OQL query.
      Returns:
      the OQL query results.
      Throws:
      org.springframework.dao.IncorrectResultSizeDataAccessException - if the query result does not match the QueryMethod return type.
      IllegalStateException - if the OQL query is not supported based on the return value.
      See Also:
      • QueryMethod
      • SelectResults