public class DefaultReactiveDataAccessStrategy extends Object implements ReactiveDataAccessStrategy
ReactiveDataAccessStrategy
implementation.Constructor and Description |
---|
DefaultReactiveDataAccessStrategy(Dialect dialect)
Creates a new
DefaultReactiveDataAccessStrategy given Dialect . |
DefaultReactiveDataAccessStrategy(Dialect dialect,
org.springframework.data.relational.core.conversion.RelationalConverter converter)
|
Modifier and Type | Method and Description |
---|---|
BindIdOperation |
deleteById(String table,
String idColumn)
Create a
DELETE … WHERE id = ? |
BindIdOperation |
deleteByIdIn(String table,
String idColumn)
Create a
DELETE … WHERE id IN (?) |
List<String> |
getAllColumns(Class<?> typeToRead) |
Map<String,SettableValue> |
getColumnsToUpdate(Object object)
Returns a
Map that maps column names to a SettableValue value. |
Sort |
getMappedSort(Class<?> typeToRead,
Sort sort)
Map the
Sort object to apply field name mapping using the type to read . |
MappingContext<org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?>,? extends org.springframework.data.relational.core.mapping.RelationalPersistentProperty> |
getMappingContext() |
org.springframework.data.relational.core.conversion.RelationalConverter |
getRelationalConverter() |
<T> BiFunction<io.r2dbc.spi.Row,io.r2dbc.spi.RowMetadata,T> |
getRowMapper(Class<T> typeToRead) |
String |
getTableName(Class<?> type) |
List<SettableValue> |
getValuesToInsert(Object object) |
BindableOperation |
insertAndReturnGeneratedKeys(String table,
Set<String> columns)
Create an
INSERT operation for the given table to insert columns . |
QueryOperation |
select(String table,
Set<String> columns,
Sort sort,
Pageable page)
Create a
SELECT … ORDER BY … LIMIT … operation for the given table using columns to
project. |
BindIdOperation |
selectById(String table,
Set<String> columns,
String idColumn)
Create a
SELECT … WHERE id = ? |
BindIdOperation |
selectById(String table,
Set<String> columns,
String idColumn,
int limit)
Create a
SELECT … WHERE id = ? |
BindIdOperation |
selectByIdIn(String table,
Set<String> columns,
String idColumn)
Create a
SELECT … WHERE id IN (?) |
BindIdOperation |
updateById(String table,
Set<String> columns,
String idColumn)
Create a
UPDATE … SET … WHERE id = ? |
public DefaultReactiveDataAccessStrategy(Dialect dialect)
DefaultReactiveDataAccessStrategy
given Dialect
.dialect
- the Dialect
to use.public org.springframework.data.relational.core.conversion.RelationalConverter getRelationalConverter()
public MappingContext<org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?>,? extends org.springframework.data.relational.core.mapping.RelationalPersistentProperty> getMappingContext()
public List<String> getAllColumns(Class<?> typeToRead)
getAllColumns
in interface ReactiveDataAccessStrategy
public List<SettableValue> getValuesToInsert(Object object)
getValuesToInsert
in interface ReactiveDataAccessStrategy
SettableValue
that represent an INSERT
of object
.public Map<String,SettableValue> getColumnsToUpdate(Object object)
ReactiveDataAccessStrategy
Map
that maps column names to a SettableValue
value.getColumnsToUpdate
in interface ReactiveDataAccessStrategy
object
- must not be null.public Sort getMappedSort(Class<?> typeToRead, Sort sort)
ReactiveDataAccessStrategy
Sort
object to apply field name mapping using the type to read
.getMappedSort
in interface ReactiveDataAccessStrategy
public <T> BiFunction<io.r2dbc.spi.Row,io.r2dbc.spi.RowMetadata,T> getRowMapper(Class<T> typeToRead)
getRowMapper
in interface ReactiveDataAccessStrategy
public String getTableName(Class<?> type)
getTableName
in interface ReactiveDataAccessStrategy
entity type
.public BindableOperation insertAndReturnGeneratedKeys(String table, Set<String> columns)
ReactiveDataAccessStrategy
INSERT
operation for the given table
to insert columns
.insertAndReturnGeneratedKeys
in interface ReactiveDataAccessStrategy
table
- the table to insert data to.columns
- column names that will be bound.BindableOperation
representing the INSERT
statement.public QueryOperation select(String table, Set<String> columns, Sort sort, Pageable page)
ReactiveDataAccessStrategy
SELECT … ORDER BY … LIMIT …
operation for the given table
using columns
to
project.select
in interface ReactiveDataAccessStrategy
table
- the table to insert data to.columns
- columns to return.public BindIdOperation selectById(String table, Set<String> columns, String idColumn)
ReactiveDataAccessStrategy
SELECT … WHERE id = ?
operation for the given table
using columns
to project and
idColumn
.selectById
in interface ReactiveDataAccessStrategy
table
- the table to insert data to.columns
- columns to return.idColumn
- name of the primary key.public BindIdOperation selectById(String table, Set<String> columns, String idColumn, int limit)
ReactiveDataAccessStrategy
SELECT … WHERE id = ?
operation for the given table
using columns
to project and
idColumn
applying a limit (TOP, LIMIT, …).selectById
in interface ReactiveDataAccessStrategy
table
- the table to insert data to.columns
- columns to return.idColumn
- name of the primary key.limit
- number of rows to return.public BindIdOperation selectByIdIn(String table, Set<String> columns, String idColumn)
ReactiveDataAccessStrategy
SELECT … WHERE id IN (?)
operation for the given table
using columns
to project
and idColumn
. The actual query
string depends on
bound parameters
.selectByIdIn
in interface ReactiveDataAccessStrategy
table
- the table to insert data to.columns
- columns to return.idColumn
- name of the primary key.public BindIdOperation updateById(String table, Set<String> columns, String idColumn)
ReactiveDataAccessStrategy
UPDATE … SET … WHERE id = ?
operation for the given table
updating columns
and
idColumn
.updateById
in interface ReactiveDataAccessStrategy
table
- the table to insert data to.columns
- columns to update.idColumn
- name of the primary key.public BindIdOperation deleteById(String table, String idColumn)
ReactiveDataAccessStrategy
DELETE … WHERE id = ?
operation for the given table
and idColumn
.deleteById
in interface ReactiveDataAccessStrategy
table
- the table to insert data to.idColumn
- name of the primary key.public BindIdOperation deleteByIdIn(String table, String idColumn)
ReactiveDataAccessStrategy
DELETE … WHERE id IN (?)
operation for the given table
and idColumn
. The actual
query
string depends on bound parameters
.deleteByIdIn
in interface ReactiveDataAccessStrategy
table
- the table to insert data to.idColumn
- name of the primary key.Copyright © 2018 Pivotal Software, Inc.. All rights reserved.