- All Known Subinterfaces:
StatementMapper.TypedStatementMapper<T>
public interface StatementMapper
Mapper for statement specifications to
PreparedOperation. Statement mapping applies a
R2dbcDialect-specific transformation considering
BindMarkers and vendor-specific SQL differences.
Mapped statements can be used directly with
DatabaseClient.sql(Supplier) without specifying further SQL or bindings as the
prepared operation encapsulates the specified SQL operation.
- Author:
- Mark Paluch, Roman Chigvintsev, Mingyuan Wu, Diego Krupitza
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classDELETEspecification.static classINSERTspecification.static classSELECTspecification.static interfaceExtension toStatementMapperthat is associated with a type.static classUPDATEspecification. -
Method Summary
Modifier and TypeMethodDescriptionstatic StatementMappercreate(R2dbcDialect dialect, R2dbcConverter converter) default StatementMapper.DeleteSpeccreateDelete(String table) Create aDELETEspecification fortable.default StatementMapper.DeleteSpeccreateDelete(org.springframework.data.relational.core.sql.SqlIdentifier table) Create aDELETEspecification fortable.default StatementMapper.InsertSpeccreateInsert(String table) Create anINSERTspecification fortable.default StatementMapper.InsertSpeccreateInsert(org.springframework.data.relational.core.sql.SqlIdentifier table) Create anINSERTspecification fortable.default StatementMapper.SelectSpeccreateSelect(String table) Create aSELECTspecification fortable.default StatementMapper.SelectSpeccreateSelect(org.springframework.data.relational.core.sql.SqlIdentifier table) Create aSELECTspecification fortable.default StatementMapper.UpdateSpeccreateUpdate(String table, org.springframework.data.relational.core.query.Update update) Create anUPDATEspecification fortable.default StatementMapper.UpdateSpeccreateUpdate(org.springframework.data.relational.core.sql.SqlIdentifier table, org.springframework.data.relational.core.query.Update update) Create anUPDATEspecification fortable.Create a typedStatementMapperthat considers type-specific mapping metadata.getMappedObject(StatementMapper.DeleteSpec deleteSpec) Map a delete specification to aPreparedOperation.getMappedObject(StatementMapper.InsertSpec insertSpec) Map a insert specification to aPreparedOperation.getMappedObject(StatementMapper.SelectSpec selectSpec) Map a select specification to aPreparedOperation.getMappedObject(StatementMapper.UpdateSpec updateSpec) Map a update specification to aPreparedOperation.default org.springframework.data.relational.core.sql.render.RenderContextReturnsRenderContext.
-
Method Details
-
create
- Parameters:
dialect- must not be null.converter- must not be null.- Returns:
- the new
StatementMapper. - Since:
- 1.2
-
forType
Create a typedStatementMapperthat considers type-specific mapping metadata.- Type Parameters:
T-- Parameters:
type- must not be null.- Returns:
- the typed
StatementMapper.
-
getMappedObject
Map a select specification to aPreparedOperation.- Parameters:
selectSpec- the insert operation definition, must not be null.- Returns:
- the
PreparedOperationforStatementMapper.SelectSpec.
-
getMappedObject
Map a insert specification to aPreparedOperation.- Parameters:
insertSpec- the insert operation definition, must not be null.- Returns:
- the
PreparedOperationforStatementMapper.InsertSpec.
-
getMappedObject
Map a update specification to aPreparedOperation.- Parameters:
updateSpec- the update operation definition, must not be null.- Returns:
- the
PreparedOperationforStatementMapper.UpdateSpec.
-
getMappedObject
Map a delete specification to aPreparedOperation.- Parameters:
deleteSpec- the update operation definition, must not be null.- Returns:
- the
PreparedOperationforStatementMapper.DeleteSpec.
-
createSelect
Create aSELECTspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.SelectSpec.
-
createSelect
default StatementMapper.SelectSpec createSelect(org.springframework.data.relational.core.sql.SqlIdentifier table) Create aSELECTspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.SelectSpec. - Since:
- 1.1
-
createInsert
Create anINSERTspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.InsertSpec.
-
createInsert
default StatementMapper.InsertSpec createInsert(org.springframework.data.relational.core.sql.SqlIdentifier table) Create anINSERTspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.InsertSpec. - Since:
- 1.1
-
createUpdate
default StatementMapper.UpdateSpec createUpdate(String table, org.springframework.data.relational.core.query.Update update) Create anUPDATEspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.UpdateSpec.
-
createUpdate
default StatementMapper.UpdateSpec createUpdate(org.springframework.data.relational.core.sql.SqlIdentifier table, org.springframework.data.relational.core.query.Update update) Create anUPDATEspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.UpdateSpec. - Since:
- 1.1
-
createDelete
Create aDELETEspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.DeleteSpec.
-
createDelete
default StatementMapper.DeleteSpec createDelete(org.springframework.data.relational.core.sql.SqlIdentifier table) Create aDELETEspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.DeleteSpec. - Since:
- 1.1
-
getRenderContext
@Nullable default org.springframework.data.relational.core.sql.render.RenderContext getRenderContext()ReturnsRenderContext.- Returns:
RenderContextinstance or null ifRenderContextis not available
-