java.lang.Object
java.lang.Record
org.litebridge.db.spi.update.Merge
- Record Components:
table- merge target tableusing- merge using table/queryon- merge conditionwhenMatched- when matched clauseswhenNotMatched- when not matched clauses
- All Implemented Interfaces:
Operation,UpdateStatement
public record Merge(SelectTarget table, SelectTarget using, ConditionGroup on, @Nullable List<Merge.WhenMatched<Merge.WhenMatchedOperation>> whenMatched, @Nullable List<Merge.WhenMatched<Merge.MergeInsert>> whenNotMatched)
extends Record
implements UpdateStatement
Logical representation of a SQL
MERGE statement.
It is used by DatabaseProvider implementations
to generate SQL MERGE statement strings.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordLogical representation of aDELETEin a mergeWHEN MATCHEDclause.static final recordLogical representation of anINSERTin a mergeWHEN NOT MATCHEDclause.static final recordLogical representation of anUPDATEin a mergeWHEN MATCHEDclause.static final recordLogical representation of a mergeWHEN MATCHED/WHEN NOT MATCHEDclause.static interfaceMarker interface for mergeWHEN MATCHEDupdate operations. -
Constructor Summary
ConstructorsConstructorDescriptionMerge(SelectTarget table, SelectTarget using, ConditionGroup on, @Nullable List<Merge.WhenMatched<Merge.WhenMatchedOperation>> whenMatched, @Nullable List<Merge.WhenMatched<Merge.MergeInsert>> whenNotMatched) Creates an instance of aMergerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.on()Returns the value of theonrecord component.table()Returns the value of thetablerecord component.final StringtoString()Returns a string representation of this record class.using()Returns the value of theusingrecord component.@Nullable List<Merge.WhenMatched<Merge.WhenMatchedOperation>> Returns the value of thewhenMatchedrecord component.@Nullable List<Merge.WhenMatched<Merge.MergeInsert>> Returns the value of thewhenNotMatchedrecord component.
-
Constructor Details
-
Merge
public Merge(SelectTarget table, SelectTarget using, ConditionGroup on, @Nullable List<Merge.WhenMatched<Merge.WhenMatchedOperation>> whenMatched, @Nullable List<Merge.WhenMatched<Merge.MergeInsert>> whenNotMatched) Creates an instance of aMergerecord class.- Parameters:
table- the value for thetablerecord componentusing- the value for theusingrecord componenton- the value for theonrecord componentwhenMatched- the value for thewhenMatchedrecord componentwhenNotMatched- the value for thewhenNotMatchedrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
table
Returns the value of thetablerecord component. -
using
Returns the value of theusingrecord component.- Returns:
- the value of the
usingrecord component
-
on
Returns the value of theonrecord component.- Returns:
- the value of the
onrecord component
-
whenMatched
Returns the value of thewhenMatchedrecord component.- Returns:
- the value of the
whenMatchedrecord component
-
whenNotMatched
Returns the value of thewhenNotMatchedrecord component.- Returns:
- the value of the
whenNotMatchedrecord component
-