Interface StatementMapper
- 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(SqlIdentifier table) Create aDELETEspecification fortable.default StatementMapper.InsertSpeccreateInsert(String table) Create anINSERTspecification fortable.default StatementMapper.InsertSpeccreateInsert(SqlIdentifier table) Create anINSERTspecification fortable.default StatementMapper.SelectSpeccreateSelect(String table) Create aSELECTspecification fortable.default StatementMapper.SelectSpeccreateSelect(SqlIdentifier table) Create aSELECTspecification fortable.default StatementMapper.UpdateSpeccreateUpdate(String table, Update update) Create anUPDATEspecification fortable.default StatementMapper.UpdateSpeccreateUpdate(SqlIdentifier table, 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 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
Create aSELECTspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.SelectSpec. - Since:
- 1.1
-
createInsert
Create anINSERTspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.InsertSpec.
-
createInsert
Create anINSERTspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.InsertSpec. - Since:
- 1.1
-
createUpdate
Create anUPDATEspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.UpdateSpec.
-
createUpdate
Create anUPDATEspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.UpdateSpec. - Since:
- 1.1
-
createDelete
Create aDELETEspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.DeleteSpec.
-
createDelete
Create aDELETEspecification fortable.- Parameters:
table-- Returns:
- the
StatementMapper.DeleteSpec. - Since:
- 1.1
-
getRenderContext
ReturnsRenderContext.- Returns:
RenderContextinstance or null ifRenderContextis not available
-