Record Class InsertConflictRenderingPlan.Merge
java.lang.Object
java.lang.Record
org.hibernate.dialect.sql.ast.spi.InsertConflictRenderingPlan.Merge
- Record Components:
terminateStatement- whether the generated merge must end with the database's statement terminator
- All Implemented Interfaces:
InsertConflictRenderingPlan
- Enclosing interface:
InsertConflictRenderingPlan
public static record InsertConflictRenderingPlan.Merge(boolean terminateStatement)
extends Record
implements InsertConflictRenderingPlan
Render a do-update insert as a merge statement.
The translator constructs a proposed-row source named excluded, joins it
to the target using the conflict columns, renders conflict assignments in
when matched, and renders the insert in when not matched:
merge into book b using (...) excluded
on (b.isbn = excluded.isbn)
when matched then update set title = excluded.title
when not matched then insert (...) values (...)
This plan is valid only for InsertConflictAction.DO_UPDATE and does not
support an explicitly named constraint.
- Since:
- 8.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface InsertConflictRenderingPlan
InsertConflictRenderingPlan.ConstraintViolation, InsertConflictRenderingPlan.Merge, InsertConflictRenderingPlan.None, InsertConflictRenderingPlan.OnDuplicateKey, InsertConflictRenderingPlan.Standard -
Constructor Summary
ConstructorsConstructorDescriptionMerge(boolean terminateStatement) 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.booleanReturns the value of theterminateStatementrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Merge
public Merge(boolean terminateStatement) Creates an instance of aMergerecord class.- Parameters:
terminateStatement- the value for theterminateStatementrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 with thecomparemethod from their corresponding wrapper classes. -
terminateStatement
public boolean terminateStatement()Returns the value of theterminateStatementrecord component.- Returns:
- the value of the
terminateStatementrecord component
-