Class AbstractJdbcMutation
java.lang.Object
org.hibernate.sql.spi.mutation.jdbc.AbstractJdbcMutation
- All Implemented Interfaces:
JdbcValueDescriptorAccess, JdbcOperation, JdbcMutationOperation, PreparableMutationOperation, MutationOperation
- Direct Known Subclasses:
JdbcDeleteMutation, JdbcInsertMutation, JdbcUpdateMutation, MergeOperation, UpsertOperation
@SPI({USE,IMPLEMENT})
public abstract class AbstractJdbcMutation
extends Object
implements JdbcMutationOperation
Supported base for an immutable, single-table JDBC mutation operation.
Subclasses select the fixed logical mutation type while this base owns the
table, SQL, parameter, callable, and expectation invariants.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractJdbcMutation(TableMapping tableDetails, MutationTarget mutationTarget, String sql, boolean callable, Expectation expectation, List<? extends JdbcParameterBinder> parameterBinders) -
Method Summary
Modifier and TypeMethodDescriptionfinal JdbcValueDescriptorfindValueDescriptor(String columnName, ParameterUsage usage) Find the JDBC parameter to be used for the specified column.final intforEachValueDescriptor(String tableName, String columnName, ParameterUsage usage, Consumer<JdbcValueDescriptor> consumer) Visit all the JDBC values used for the given column and parameter usage.The relational tables or backend-equivalent query spaces referred to by this operation.final ExpectationThe expected outcome of executionfinal MutationTargetThe thing being mutatedabstract MutationTypeThe type of operation (INSERT, etc)final List<? extends JdbcParameterBinder> The list of parameter binders for the generated PreparedStatement.final StringThe command text to execute through JDBC.final TableMappingThe table against which operation is to be performedfinal booleanWhether the operation is callableMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MutationOperation
getJdbcValueDescriptor, resolvePhysicalTableName, resolveValueDescriptorMethods inherited from interface PreparableMutationOperation
canBeBatched, canRetry
-
Constructor Details
-
AbstractJdbcMutation
@SPI(IMPLEMENT) protected AbstractJdbcMutation(TableMapping tableDetails, MutationTarget mutationTarget, String sql, boolean callable, Expectation expectation, List<? extends JdbcParameterBinder> parameterBinders)
-
-
Method Details
-
getTableDetails
Description copied from interface:MutationOperationThe table against which operation is to be performed- Specified by:
getTableDetailsin interfaceMutationOperation
-
getAffectedTableNames
Description copied from interface:JdbcOperationThe relational tables or backend-equivalent query spaces referred to by this operation.- Specified by:
getAffectedTableNamesin interfaceJdbcOperation
-
getMutationTarget
Description copied from interface:MutationOperationThe thing being mutated- Specified by:
getMutationTargetin interfaceMutationOperation
-
getSqlString
Description copied from interface:JdbcOperationThe command text to execute through JDBC. This is ordinarily SQL, but may use another language understood by the configured JDBC driver.- Specified by:
getSqlStringin interfaceJdbcOperation- Specified by:
getSqlStringin interfacePreparableMutationOperation
-
getParameterBinders
Description copied from interface:JdbcOperationThe list of parameter binders for the generated PreparedStatement.- Specified by:
getParameterBindersin interfaceJdbcOperation- Specified by:
getParameterBindersin interfacePreparableMutationOperation
-
findValueDescriptor
Description copied from interface:MutationOperationFind the JDBC parameter to be used for the specified column.- Specified by:
findValueDescriptorin interfaceMutationOperation- Returns:
- The descriptor, or null if none match.
- See Also:
-
forEachValueDescriptor
public final int forEachValueDescriptor(String tableName, String columnName, ParameterUsage usage, Consumer<JdbcValueDescriptor> consumer) Description copied from interface:JdbcValueDescriptorAccessVisit all the JDBC values used for the given column and parameter usage.
A SQL AST translator may render an expression more than once while emulating a predicate, so a single logical value can correspond to multiple JDBC parameters.
- Specified by:
forEachValueDescriptorin interfaceJdbcValueDescriptorAccess
-
isCallable
public final boolean isCallable()Description copied from interface:PreparableMutationOperationWhether the operation is callable- Specified by:
isCallablein interfacePreparableMutationOperation
-
getExpectation
Description copied from interface:PreparableMutationOperationThe expected outcome of execution- Specified by:
getExpectationin interfacePreparableMutationOperation
-
getMutationType
Description copied from interface:MutationOperationThe type of operation (INSERT, etc)- Specified by:
getMutationTypein interfaceMutationOperation
-