Interface MutationOperation
- All Superinterfaces:
JdbcValueDescriptorAccess
- All Known Subinterfaces:
JdbcMutationOperation, PreparableMutationOperation, SelfExecutingUpdateOperation
- All Known Implementing Classes:
AbstractJdbcMutation, DeleteOrUpsertOperation, JdbcDeleteMutation, JdbcInsertMutation, JdbcUpdateMutation, MergeOperation, OptionalTableUpdateOperation, OptionalTableUpdateWithUpsertOperation, UpsertOperation
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"
- Implementation Specification:
- MutationOperation extends JdbcValueDescriptorAccess for easily bridging between coordinators (legacy queue) and decomposers (graph-based queue). JdbcValueDescriptorAccess contract passes in a table-name, but here we'll just verify (assert) that the passed name matches the name of the table being mutated here.
-
Method Summary
Modifier and TypeMethodDescriptionfindValueDescriptor(String columnName, ParameterUsage usage) Find the JDBC parameter to be used for the specified column.default JdbcValueDescriptorgetJdbcValueDescriptor(String columnName, ParameterUsage usage) Form offindValueDescriptor(String, ParameterUsage), throwing an exception if not found as opposed to simply returning nullMutationTarget<?, ?> The thing being mutatedThe type of operation (INSERT, etc)The table against which operation is to be performeddefault StringresolvePhysicalTableName(String tableName) default JdbcValueDescriptorresolveValueDescriptor(String tableName, String columnName, ParameterUsage usage) Locate type details about
-
Method Details
-
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
Find the JDBC parameter to be used for the specified column.- Returns:
- The descriptor, or null if none match.
- See Also:
-
getJdbcValueDescriptor
Form offindValueDescriptor(String, ParameterUsage), throwing an exception if not found as opposed to simply returning null -
resolvePhysicalTableName
- Specified by:
resolvePhysicalTableNamein interfaceJdbcValueDescriptorAccess
-
resolveValueDescriptor
default JdbcValueDescriptor resolveValueDescriptor(String tableName, String columnName, ParameterUsage usage) Description copied from interface:JdbcValueDescriptorAccessLocate type details about- Specified by:
resolveValueDescriptorin interfaceJdbcValueDescriptorAccess
-