Package org.hibernate.query.criteria
Interface JpaConflictClause<T>
- All Known Implementing Classes:
SqmConflictClause
A conflict clause for insert statements.
- Since:
- 6.5
-
Method Summary
Modifier and TypeMethodDescriptionconflictOnConstraint(@Nullable String constraintName) Sets the unique constraint name for which a constraint violation is allowed.conflictOnConstraintAttributes(SingularAttribute<T, ?>... attributes) Shorthand for callingconflictOnConstraintPaths(List)with paths resolved for the given attributes against the insert target.conflictOnConstraintAttributes(String... attributes) Shorthand for callingconflictOnConstraintPaths(List)with paths resolved for the given attributes against the insert target.conflictOnConstraintPaths(Path<?>... paths) conflictOnConstraintPaths(List<? extends Path<?>> paths) Sets the paths which are part of a unique constraint, for which a constraint violation is allowed.Create a new conflict update action for this insert statement.@Nullable JpaConflictUpdateAction<T> The action to do when a conflict due to a unique constraint violation happens.@Nullable StringThe unique constraint name for which a constraint violation is allowed.The paths which are part of a unique constraint, for which a constraint violation is allowed.The excluded row/object which was not inserted.onConflictDo(@Nullable JpaConflictUpdateAction<T> action) Sets the action to do on a conflict.default JpaConflictClause<T> Shorthand version for callingonConflictDo(JpaConflictUpdateAction)with anullargument.default JpaConflictUpdateAction<T> Shorthand version for callingonConflictDo(JpaConflictUpdateAction)withcreateConflictUpdateAction()as argument and returning the update action.
-
Method Details
-
getExcludedRoot
The excluded row/object which was not inserted. -
getConstraintName
@Nullable String getConstraintName()The unique constraint name for which a constraint violation is allowed. -
conflictOnConstraint
Sets the unique constraint name for which a constraint violation is allowed.- Throws:
IllegalStateException- when constraint paths have already been defined
-
getConstraintPaths
The paths which are part of a unique constraint, for which a constraint violation is allowed. -
conflictOnConstraintAttributes
Shorthand for callingconflictOnConstraintPaths(List)with paths resolved for the given attributes against the insert target. -
conflictOnConstraintAttributes
Shorthand for callingconflictOnConstraintPaths(List)with paths resolved for the given attributes against the insert target. -
conflictOnConstraintPaths
-
conflictOnConstraintPaths
Sets the paths which are part of a unique constraint, for which a constraint violation is allowed.- Throws:
IllegalStateException- when a constraint name has already been defined
-
getConflictAction
@Nullable JpaConflictUpdateAction<T> getConflictAction()The action to do when a conflict due to a unique constraint violation happens. -
onConflictDo
Sets the action to do on a conflict. Settingnullmeans to do nothing.- See Also:
-
onConflictDoUpdate
Shorthand version for callingonConflictDo(JpaConflictUpdateAction)withcreateConflictUpdateAction()as argument and returning the update action. -
onConflictDoNothing
Shorthand version for callingonConflictDo(JpaConflictUpdateAction)with anullargument. -
createConflictUpdateAction
JpaConflictUpdateAction<T> createConflictUpdateAction()Create a new conflict update action for this insert statement.- Returns:
- a new conflict update action
- See Also:
-