public class DefaultReactiveDataAccessStrategy extends Object implements ReactiveDataAccessStrategy
ReactiveDataAccessStrategy
implementation.ReactiveDataAccessStrategy.NamedParameterProvider
Constructor and Description |
---|
DefaultReactiveDataAccessStrategy(R2dbcDialect dialect)
|
DefaultReactiveDataAccessStrategy(R2dbcDialect dialect,
Collection<?> converters)
|
DefaultReactiveDataAccessStrategy(R2dbcDialect dialect,
R2dbcConverter converter)
|
DefaultReactiveDataAccessStrategy(R2dbcDialect dialect,
R2dbcConverter converter,
NamedParameterExpander expander)
|
Modifier and Type | Method and Description |
---|---|
static R2dbcConverter |
createConverter(R2dbcDialect dialect,
Collection<?> converters)
|
List<org.springframework.data.relational.core.sql.SqlIdentifier> |
getAllColumns(Class<?> entityType) |
Parameter |
getBindValue(Parameter value)
Return a potentially converted
Parameter for strategies that support type conversion. |
SettableValue |
getBindValue(SettableValue value)
Return a potentially converted
SettableValue for strategies that support type conversion. |
R2dbcConverter |
getConverter()
Returns the
R2dbcConverter . |
List<org.springframework.data.relational.core.sql.SqlIdentifier> |
getIdentifierColumns(Class<?> entityType) |
MappingContext<org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?>,? extends org.springframework.data.relational.core.mapping.RelationalPersistentProperty> |
getMappingContext() |
OutboundRow |
getOutboundRow(Object object)
Returns a
OutboundRow that maps column names to a Parameter value. |
<T> BiFunction<Row,RowMetadata,T> |
getRowMapper(Class<T> typeToRead)
|
StatementMapper |
getStatementMapper()
Returns the
R2dbcDialect -specific StatementMapper . |
org.springframework.data.relational.core.sql.SqlIdentifier |
getTableName(Class<?> type) |
PreparedOperation<?> |
processNamedParameters(String query,
ReactiveDataAccessStrategy.NamedParameterProvider parameterProvider)
Expand named parameters and return a
PreparedOperation wrapping the given bindings. |
String |
renderForGeneratedValues(org.springframework.data.relational.core.sql.SqlIdentifier identifier)
Render a
SqlIdentifier in a way suitable for registering it as a generated key with a statement through
Statement#returnGeneratedValues . |
String |
toSql(org.springframework.data.relational.core.sql.SqlIdentifier identifier)
Render a
SqlIdentifier for SQL usage. |
public DefaultReactiveDataAccessStrategy(R2dbcDialect dialect)
dialect
- the R2dbcDialect
to use.public DefaultReactiveDataAccessStrategy(R2dbcDialect dialect, Collection<?> converters)
dialect
- the R2dbcDialect
to use.converters
- custom converters to register, must not be null.R2dbcCustomConversions
,
Converter
public DefaultReactiveDataAccessStrategy(R2dbcDialect dialect, R2dbcConverter converter)
dialect
- the R2dbcDialect
to use.converter
- must not be null.public DefaultReactiveDataAccessStrategy(R2dbcDialect dialect, R2dbcConverter converter, NamedParameterExpander expander)
dialect
- the R2dbcDialect
to use.converter
- must not be null.expander
- must not be null.public static R2dbcConverter createConverter(R2dbcDialect dialect, Collection<?> converters)
dialect
- must not be null.converters
- must not be null.R2dbcConverter
.public List<org.springframework.data.relational.core.sql.SqlIdentifier> getAllColumns(Class<?> entityType)
getAllColumns
in interface ReactiveDataAccessStrategy
public List<org.springframework.data.relational.core.sql.SqlIdentifier> getIdentifierColumns(Class<?> entityType)
getIdentifierColumns
in interface ReactiveDataAccessStrategy
public OutboundRow getOutboundRow(Object object)
ReactiveDataAccessStrategy
OutboundRow
that maps column names to a Parameter
value.getOutboundRow
in interface ReactiveDataAccessStrategy
object
- must not be null.public SettableValue getBindValue(SettableValue value)
ReactiveDataAccessStrategy
SettableValue
for strategies that support type conversion.getBindValue
in interface ReactiveDataAccessStrategy
value
- must not be null.public Parameter getBindValue(Parameter value)
ReactiveDataAccessStrategy
Parameter
for strategies that support type conversion.getBindValue
in interface ReactiveDataAccessStrategy
value
- must not be null.public <T> BiFunction<Row,RowMetadata,T> getRowMapper(Class<T> typeToRead)
ReactiveDataAccessStrategy
getRowMapper
in interface ReactiveDataAccessStrategy
public PreparedOperation<?> processNamedParameters(String query, ReactiveDataAccessStrategy.NamedParameterProvider parameterProvider)
ReactiveDataAccessStrategy
PreparedOperation
wrapping the given bindings.processNamedParameters
in interface ReactiveDataAccessStrategy
query
- the query to expand.parameterProvider
- indexed parameter bindings.PreparedOperation
encapsulating expanded SQL and namedBindings.public org.springframework.data.relational.core.sql.SqlIdentifier getTableName(Class<?> type)
getTableName
in interface ReactiveDataAccessStrategy
entity type
.public String toSql(org.springframework.data.relational.core.sql.SqlIdentifier identifier)
ReactiveDataAccessStrategy
SqlIdentifier
for SQL usage.toSql
in interface ReactiveDataAccessStrategy
identifier
- the identifier to be rendered.SqlIdentifier.toSql(IdentifierProcessing)
public StatementMapper getStatementMapper()
ReactiveDataAccessStrategy
R2dbcDialect
-specific StatementMapper
.getStatementMapper
in interface ReactiveDataAccessStrategy
R2dbcDialect
-specific StatementMapper
.public R2dbcConverter getConverter()
ReactiveDataAccessStrategy
R2dbcConverter
.getConverter
in interface ReactiveDataAccessStrategy
R2dbcConverter
.public MappingContext<org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?>,? extends org.springframework.data.relational.core.mapping.RelationalPersistentProperty> getMappingContext()
public String renderForGeneratedValues(org.springframework.data.relational.core.sql.SqlIdentifier identifier)
ReactiveDataAccessStrategy
SqlIdentifier
in a way suitable for registering it as a generated key with a statement through
Statement#returnGeneratedValues
.renderForGeneratedValues
in interface ReactiveDataAccessStrategy
identifier
- to render. Must not be null.Copyright © 2018–2022 Pivotal Software, Inc.. All rights reserved.