Class StringBasedR2dbcQuery
java.lang.Object
org.springframework.data.r2dbc.repository.query.AbstractR2dbcQuery
org.springframework.data.r2dbc.repository.query.StringBasedR2dbcQuery
- All Implemented Interfaces:
RepositoryQuery
String-based
StringBasedR2dbcQuery
implementation.
A StringBasedR2dbcQuery
expects a query method to be annotated with Query
with a SQL query. Supports
named parameters (if enabled on DatabaseClient
) and SpEL expressions enclosed with :#{…}
.
- Author:
- Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionStringBasedR2dbcQuery
(String query, R2dbcQueryMethod method, R2dbcEntityOperations entityOperations, R2dbcConverter converter, ReactiveDataAccessStrategy dataAccessStrategy, ExpressionParser expressionParser, ReactiveQueryMethodEvaluationContextProvider evaluationContextProvider) Create a newStringBasedR2dbcQuery
for the givenquery
,R2dbcQueryMethod
,DatabaseClient
,SpelExpressionParser
, andQueryMethodEvaluationContextProvider
.StringBasedR2dbcQuery
(R2dbcQueryMethod queryMethod, R2dbcEntityOperations entityOperations, R2dbcConverter converter, ReactiveDataAccessStrategy dataAccessStrategy, ExpressionParser expressionParser, ReactiveQueryMethodEvaluationContextProvider evaluationContextProvider) Creates a newStringBasedR2dbcQuery
for the givenStringBasedR2dbcQuery
,DatabaseClient
,SpelExpressionParser
, andQueryMethodEvaluationContextProvider
. -
Method Summary
Modifier and TypeMethodDescriptionprotected reactor.core.publisher.Mono<PreparedOperation<?>>
createQuery
(org.springframework.data.relational.repository.query.RelationalParameterAccessor accessor) Creates aBindableQuery
instance using the givenParameterAccessor
protected boolean
Returns whether the query should get a count projection applied.protected boolean
Returns whether the query should get an exists projection applied.protected boolean
Returns whether this query is a modifying one.toString()
Methods inherited from class org.springframework.data.r2dbc.repository.query.AbstractR2dbcQuery
execute, getQueryMethod
-
Constructor Details
-
StringBasedR2dbcQuery
public StringBasedR2dbcQuery(R2dbcQueryMethod queryMethod, R2dbcEntityOperations entityOperations, R2dbcConverter converter, ReactiveDataAccessStrategy dataAccessStrategy, ExpressionParser expressionParser, ReactiveQueryMethodEvaluationContextProvider evaluationContextProvider) Creates a newStringBasedR2dbcQuery
for the givenStringBasedR2dbcQuery
,DatabaseClient
,SpelExpressionParser
, andQueryMethodEvaluationContextProvider
.- Parameters:
queryMethod
- must not be null.entityOperations
- must not be null.converter
- must not be null.dataAccessStrategy
- must not be null.expressionParser
- must not be null.evaluationContextProvider
- must not be null.
-
StringBasedR2dbcQuery
public StringBasedR2dbcQuery(String query, R2dbcQueryMethod method, R2dbcEntityOperations entityOperations, R2dbcConverter converter, ReactiveDataAccessStrategy dataAccessStrategy, ExpressionParser expressionParser, ReactiveQueryMethodEvaluationContextProvider evaluationContextProvider) Create a newStringBasedR2dbcQuery
for the givenquery
,R2dbcQueryMethod
,DatabaseClient
,SpelExpressionParser
, andQueryMethodEvaluationContextProvider
.- Parameters:
method
- must not be null.entityOperations
- must not be null.converter
- must not be null.dataAccessStrategy
- must not be null.expressionParser
- must not be null.evaluationContextProvider
- must not be null.
-
-
Method Details
-
isModifyingQuery
protected boolean isModifyingQuery()Description copied from class:AbstractR2dbcQuery
Returns whether this query is a modifying one.- Specified by:
isModifyingQuery
in classAbstractR2dbcQuery
- Returns:
-
isCountQuery
protected boolean isCountQuery()Description copied from class:AbstractR2dbcQuery
Returns whether the query should get a count projection applied.- Specified by:
isCountQuery
in classAbstractR2dbcQuery
- Returns:
-
isExistsQuery
protected boolean isExistsQuery()Description copied from class:AbstractR2dbcQuery
Returns whether the query should get an exists projection applied.- Specified by:
isExistsQuery
in classAbstractR2dbcQuery
- Returns:
-
createQuery
protected reactor.core.publisher.Mono<PreparedOperation<?>> createQuery(org.springframework.data.relational.repository.query.RelationalParameterAccessor accessor) Description copied from class:AbstractR2dbcQuery
Creates aBindableQuery
instance using the givenParameterAccessor
- Specified by:
createQuery
in classAbstractR2dbcQuery
- Parameters:
accessor
- must not be null.- Returns:
- a mono emitting a
BindableQuery
.
-
toString
-