Class AbstractRestrictedTableMutationBuilder<O extends MutationOperation, M extends RestrictedTableMutation<O>>
java.lang.Object
org.hibernate.sql.ast.spi.model.builder.AbstractTableMutationBuilder<M>
org.hibernate.sql.ast.spi.model.builder.AbstractRestrictedTableMutationBuilder<O,M>
- All Implemented Interfaces:
RestrictedTableMutationBuilder<O,M>, TableMutationBuilder<M>
- Direct Known Subclasses:
AbstractTableUpdateBuilder, TableDeleteBuilderStandard
@SPI(IMPLEMENT)
public abstract class AbstractRestrictedTableMutationBuilder<O extends MutationOperation, M extends RestrictedTableMutation<O>>
extends AbstractTableMutationBuilder<M>
implements RestrictedTableMutationBuilder<O,M>
Base for provider-owned table-mutation builders which collect key and optimistic-lock restrictions.
Extend this class for update or delete forms whose command restricts the
affected rows. Choose the constructor accepting a TableMapping when the
builder should create the mutating table reference, or supply an existing
MutatingTableReference when reference identity must be preserved.
- Since:
- 8.0
-
Field Summary
Fields inherited from interface TableMutationBuilder
NOT_NULL, NULL -
Constructor Summary
ConstructorsConstructorDescriptionAbstractRestrictedTableMutationBuilder(MutationType mutationType, MutationTarget mutationTarget, MutatingTableReference tableReference, SessionFactoryImplementor sessionFactory) Create a restricted builder using the supplied mutating-table reference.AbstractRestrictedTableMutationBuilder(MutationType mutationType, MutationTarget mutationTarget, TableMapping table, SessionFactoryImplementor sessionFactory) Create a restricted builder which owns a new reference totable. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddKeyRestrictionBinding(SelectableMapping selectableMapping) Add a restriction as long as the selectable is not a formula and is not nullablevoidaddNonKeyRestriction(SelectableMapping restrictableMapping, String restrictionExpression) Adds a restriction, which is assumed to be based on a selectable that is NOT a table key, e.g.voidaddNonKeyRestriction(ColumnValueBinding valueBinding) Adds a restriction, which is assumed to be based on a selectable that is NOT a table key, e.g.voidvoidaddOptimisticLockRestriction(SelectableMapping selectableMapping) Add restriction based on non-version optimistically-locked columnvoidaddWhereFragment(String fragment) protected voidadjustCustomSqlTenantRestriction(TableMapping.MutationDetails details, List<ColumnValueParameter> parameters) Custom SQL may use the original parameter list or append the session tenant.voidMethods inherited from class AbstractTableMutationBuilder
addColumn, combine, createValueBinding, createValueBinding, getJdbcServices, getMutatingTable, getMutationTarget, getParameters, getSessionFactory, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface RestrictedTableMutationBuilder
addKeyRestriction, addKeyRestrictionLeniently, addKeyRestrictions, addKeyRestrictionsLeniently, addNonKeyRestriction, addNullRestriction, addOptimisticLockRestriction, addOptimisticLockRestrictionsMethods inherited from interface TableMutationBuilder
buildMutation, getMutatingTable, hasValueBindings
-
Constructor Details
-
AbstractRestrictedTableMutationBuilder
@SPI(IMPLEMENT) public AbstractRestrictedTableMutationBuilder(MutationType mutationType, MutationTarget mutationTarget, TableMapping table, SessionFactoryImplementor sessionFactory) Create a restricted builder which owns a new reference totable. -
AbstractRestrictedTableMutationBuilder
@SPI(IMPLEMENT) public AbstractRestrictedTableMutationBuilder(MutationType mutationType, MutationTarget mutationTarget, MutatingTableReference tableReference, SessionFactoryImplementor sessionFactory) Create a restricted builder using the supplied mutating-table reference.
-
-
Method Details
-
getKeyRestrictionBindings
- Specified by:
getKeyRestrictionBindingsin interfaceRestrictedTableMutationBuilder<O extends MutationOperation, M extends RestrictedTableMutation<O>>
-
getOptimisticLockBindings
- Specified by:
getOptimisticLockBindingsin interfaceRestrictedTableMutationBuilder<O extends MutationOperation, M extends RestrictedTableMutation<O>>
-
adjustCustomSqlTenantRestriction
protected void adjustCustomSqlTenantRestriction(TableMapping.MutationDetails details, List<ColumnValueParameter> parameters) Custom SQL may use the original parameter list or append the session tenant. Remove the tenant descriptor as well as its restriction when it is omitted. The count cannot identify omitted or reordered non-tenant parameters: the custom SQL must preserve the original parameter list and its order. -
addNonKeyRestriction
Description copied from interface:RestrictedTableMutationBuilderAdds a restriction, which is assumed to be based on a selectable that is NOT a table key, e.g. optimistic locking.- Specified by:
addNonKeyRestrictionin interfaceRestrictedTableMutationBuilder<O extends MutationOperation, M extends RestrictedTableMutation<O>>
-
addNonKeyRestriction
public void addNonKeyRestriction(SelectableMapping restrictableMapping, String restrictionExpression) Description copied from interface:RestrictedTableMutationBuilderAdds a restriction, which is assumed to be based on a selectable that is NOT a table key, e.g. optimistic locking.- Specified by:
addNonKeyRestrictionin interfaceRestrictedTableMutationBuilder<O extends MutationOperation, M extends RestrictedTableMutation<O>>
-
addKeyRestrictionBinding
Description copied from interface:RestrictedTableMutationBuilderAdd a restriction as long as the selectable is not a formula and is not nullable- Specified by:
addKeyRestrictionBindingin interfaceRestrictedTableMutationBuilder<O extends MutationOperation, M extends RestrictedTableMutation<O>>
-
addNullOptimisticLockRestriction
- Specified by:
addNullOptimisticLockRestrictionin interfaceRestrictedTableMutationBuilder<O extends MutationOperation, M extends RestrictedTableMutation<O>>
-
addOptimisticLockRestriction
Description copied from interface:RestrictedTableMutationBuilderAdd restriction based on non-version optimistically-locked column- Specified by:
addOptimisticLockRestrictionin interfaceRestrictedTableMutationBuilder<O extends MutationOperation, M extends RestrictedTableMutation<O>>
-
setWhere
- Specified by:
setWherein interfaceRestrictedTableMutationBuilder<O extends MutationOperation, M extends RestrictedTableMutation<O>>
-
addWhereFragment
- Specified by:
addWhereFragmentin interfaceRestrictedTableMutationBuilder<O extends MutationOperation, M extends RestrictedTableMutation<O>>
-