Package org.hibernate.sql.model
Interface MutationOperation
-
- All Known Subinterfaces:
JdbcMutationOperation
,PreparableMutationOperation
,SelfExecutingUpdateOperation
- All Known Implementing Classes:
AbstractJdbcMutation
,DeleteOrUpsertOperation
,JdbcDeleteMutation
,JdbcInsertMutation
,JdbcUpdateMutation
,MergeOperation
,OptionalTableUpdateOperation
,UpsertOperation
@Incubating public interface MutationOperation
Mutation for a specific table as part of a logical mutation on the entity. Functional behavior is driven by the specific subtypes: example #1 - delete simple entity (Person) (1) MutationOperation(DELETE, person) example #2 - delete entity (Person) w/ secondary *non-optional* table (1) MutationOperation(DELETE, person) (2) MutationOperation(DELETE, person_supp) example #3 - insert simple entity (Person) (1) MutationOperation(INSERT, person) example #4 - insert entity (Person) w/ secondary *non-optional* table & IDENTITY id column (1) MutationOperation(INSERT, person) (2) MutationOperation(INSERT, person_supp) example #6 - update/merge entity (Person) w/ secondary *optional* table (1) MutationOperation(UPDATE, person) (2) MutationOperation(UPDATE, person_supp) - upsert / delete account for batching example #1 - insert entity (Person) w/ secondary *optional* table (1) MutationOperation(INSERT, person) - batched, all (2) MutationOperation(INSERT, person_supp) - batched, conditional[1] example #2 - delete entity (Person) w/ secondary table (1) MutationOperation(DELETE, person) - batched, all (2) MutationOperation(DELETE, person_supp) - batched, all example #3 - update/merge entity (Person) w/ secondary *optional* table (1) MutationOperation(UPDATE, person) - batched (2) MutationOperation(UPDATE, person_supp) - non-batched [1] For insertions with optional secondary tables, if the values are all null for that table we do not want to perform the "add-to-batch" handling for that specific "row"
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description JdbcValueDescriptor
findValueDescriptor(String columnName, ParameterUsage usage)
Find the JDBC parameter to be used for the specified column.default JdbcValueDescriptor
getJdbcValueDescriptor(String columnName, ParameterUsage usage)
Form offindValueDescriptor(java.lang.String, org.hibernate.engine.jdbc.mutation.ParameterUsage)
, throwing an exception if not found as opposed to simply returning nullMutationTarget<?>
getMutationTarget()
The thing being mutatedMutationType
getMutationType()
The type of operation (INSERT, etc)TableMapping
getTableDetails()
The table against which operation is to be performed
-
-
-
Method Detail
-
getMutationType
MutationType getMutationType()
The type of operation (INSERT, etc)
-
getMutationTarget
MutationTarget<?> getMutationTarget()
The thing being mutated
-
getTableDetails
TableMapping getTableDetails()
The table against which operation is to be performed
-
findValueDescriptor
JdbcValueDescriptor findValueDescriptor(String columnName, ParameterUsage usage)
Find the JDBC parameter to be used for the specified column.- Returns:
- The descriptor, or null if none match.
- See Also:
getJdbcValueDescriptor(java.lang.String, org.hibernate.engine.jdbc.mutation.ParameterUsage)
-
getJdbcValueDescriptor
default JdbcValueDescriptor getJdbcValueDescriptor(String columnName, ParameterUsage usage)
Form offindValueDescriptor(java.lang.String, org.hibernate.engine.jdbc.mutation.ParameterUsage)
, throwing an exception if not found as opposed to simply returning null
-
-