Class AbstractJdbcQuery
java.lang.Object
org.springframework.data.jdbc.repository.query.AbstractJdbcQuery
- All Implemented Interfaces:
org.springframework.data.repository.query.RepositoryQuery
- Direct Known Subclasses:
PartTreeJdbcQuery
,StringBasedJdbcQuery
public abstract class AbstractJdbcQuery
extends Object
implements org.springframework.data.repository.query.RepositoryQuery
Base class for queries based on a repository method. It holds the infrastructure for executing a query and knows how
to execute a query based on the return type of the method. How to construct the query is left to subclasses.
- Since:
- 2.0
- Author:
- Jens Schauder, Kazuki Shimizu, Oliver Gierke, Maciej Walkowiak, Mark Paluch, Dennis Effing, Mikhail Polivakha
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
static interface
Factory to create aRowMapper
for a given class. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.data.jdbc.repository.query.JdbcQueryExecution<Object>
protected org.springframework.data.jdbc.repository.query.JdbcQueryExecution<?>
createReadingQueryExecution
(ResultSetExtractor<?> extractor, RowMapper<?> rowMapper) protected org.springframework.data.jdbc.repository.query.JdbcQueryExecution<?>
getQueryExecution
(JdbcQueryMethod queryMethod, ResultSetExtractor<?> extractor, RowMapper<?> rowMapper) Deprecated, for removal: This API element is subject to removal in a future version.protected Class<?>
resolveTypeToRead
(org.springframework.data.repository.query.ResultProcessor resultProcessor) Obtain the result type to read fromResultProcessor
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.repository.query.RepositoryQuery
execute
-
Method Details
-
getQueryMethod
- Specified by:
getQueryMethod
in interfaceorg.springframework.data.repository.query.RepositoryQuery
-
getQueryExecution
@Deprecated(since="3.1", forRemoval=true) protected org.springframework.data.jdbc.repository.query.JdbcQueryExecution<?> getQueryExecution(JdbcQueryMethod queryMethod, @Nullable ResultSetExtractor<?> extractor, RowMapper<?> rowMapper) Deprecated, for removal: This API element is subject to removal in a future version.Creates aJdbcQueryExecution
given aJdbcQueryMethod
, and acResultSetExtractor
or aRowMapper
. Prefers the givenResultSetExtractor
overRowMapper
.- Parameters:
queryMethod
- must not be null.extractor
- must not be null.rowMapper
- must not be null.- Returns:
- a JdbcQueryExecution appropriate for queryMethod. Guaranteed to be not null.
-
createReadingQueryExecution
protected org.springframework.data.jdbc.repository.query.JdbcQueryExecution<?> createReadingQueryExecution(@Nullable ResultSetExtractor<?> extractor, RowMapper<?> rowMapper) Creates aJdbcQueryExecution
given aResultSetExtractor
or aRowMapper
. Prefers the givenResultSetExtractor
overRowMapper
.- Parameters:
extractor
- must not be null.rowMapper
- must not be null.- Returns:
- a JdbcQueryExecution appropriate for queryMethod. Guaranteed to be not null.
-
createModifyingQueryExecutor
protected org.springframework.data.jdbc.repository.query.JdbcQueryExecution<Object> createModifyingQueryExecutor() -
resolveTypeToRead
protected Class<?> resolveTypeToRead(org.springframework.data.repository.query.ResultProcessor resultProcessor) Obtain the result type to read fromResultProcessor
.- Parameters:
resultProcessor
- theResultProcessor
used to determine the result type. Must not be null.- Returns:
- the type that should get loaded from the database before it gets converted into the actual return type of a method. Guaranteed to be not null.
-
createReadingQueryExecution(ResultSetExtractor, RowMapper)
instead.