Class SqmConflictClause<T>
- java.lang.Object
-
- org.hibernate.query.sqm.tree.insert.SqmConflictClause<T>
-
- All Implemented Interfaces:
Serializable,JpaConflictClause<T>,JpaCriteriaNode,SqmNode,SqmVisitableNode
public class SqmConflictClause<T> extends Object implements SqmVisitableNode, JpaConflictClause<T>
- Since:
- 6.5
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SqmConflictClause(SqmInsertStatement<T> insertStatement)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <X> Xaccept(SemanticQueryWalker<X> walker)Accept the walker per visitationvoidappendHqlString(StringBuilder sb)SqmConflictClause<T>conflictOnConstraint(@Nullable String constraintName)Sets the unique constraint name for which a constraint violation is allowed.JpaConflictClause<T>conflictOnConstraintAttributes(SingularAttribute<T,?>... attributes)Shorthand for callingJpaConflictClause.conflictOnConstraintPaths(List)with paths resolved for the given attributes against the insert target.JpaConflictClause<T>conflictOnConstraintAttributes(String... attributes)Shorthand for callingJpaConflictClause.conflictOnConstraintPaths(List)with paths resolved for the given attributes against the insert target.SqmConflictClause<T>conflictOnConstraintPaths(Path<?>... paths)SqmConflictClause<T>conflictOnConstraintPaths(List<? extends Path<?>> paths)Sets the paths which are part of a unique constraint, for which a constraint violation is allowed.SqmConflictClause<T>copy(SqmCopyContext context)SqmConflictUpdateAction<T>createConflictUpdateAction()Create a new conflict update action for this insert statement.@Nullable SqmConflictUpdateAction<T>getConflictAction()The action to do when a conflict due to a unique constraint violation happens.@Nullable StringgetConstraintName()The unique constraint name for which a constraint violation is allowed.List<SqmPath<?>>getConstraintPaths()The paths which are part of a unique constraint, for which a constraint violation is allowed.SqmRoot<T>getExcludedRoot()The excluded row/object which was not inserted.NodeBuildernodeBuilder()JpaConflictClause<T>onConflictDo(JpaConflictUpdateAction<T> action)Sets the action to do on a conflict.SqmConflictUpdateAction<T>onConflictDoUpdate()Shorthand version for callingJpaConflictClause.onConflictDo(JpaConflictUpdateAction)withJpaConflictClause.createConflictUpdateAction()as argument and returning the update action.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.query.criteria.JpaConflictClause
onConflictDoNothing
-
Methods inherited from interface org.hibernate.query.sqm.tree.SqmNode
asLoggableText
-
Methods inherited from interface org.hibernate.query.sqm.tree.SqmVisitableNode
toHqlString
-
-
-
-
Constructor Detail
-
SqmConflictClause
public SqmConflictClause(SqmInsertStatement<T> insertStatement)
-
-
Method Detail
-
getExcludedRoot
public SqmRoot<T> getExcludedRoot()
Description copied from interface:JpaConflictClauseThe excluded row/object which was not inserted.- Specified by:
getExcludedRootin interfaceJpaConflictClause<T>
-
getConstraintName
public @Nullable String getConstraintName()
Description copied from interface:JpaConflictClauseThe unique constraint name for which a constraint violation is allowed.- Specified by:
getConstraintNamein interfaceJpaConflictClause<T>
-
conflictOnConstraint
public SqmConflictClause<T> conflictOnConstraint(@Nullable String constraintName)
Description copied from interface:JpaConflictClauseSets the unique constraint name for which a constraint violation is allowed.- Specified by:
conflictOnConstraintin interfaceJpaConflictClause<T>
-
conflictOnConstraintAttributes
public JpaConflictClause<T> conflictOnConstraintAttributes(String... attributes)
Description copied from interface:JpaConflictClauseShorthand for callingJpaConflictClause.conflictOnConstraintPaths(List)with paths resolved for the given attributes against the insert target.- Specified by:
conflictOnConstraintAttributesin interfaceJpaConflictClause<T>
-
conflictOnConstraintAttributes
public JpaConflictClause<T> conflictOnConstraintAttributes(SingularAttribute<T,?>... attributes)
Description copied from interface:JpaConflictClauseShorthand for callingJpaConflictClause.conflictOnConstraintPaths(List)with paths resolved for the given attributes against the insert target.- Specified by:
conflictOnConstraintAttributesin interfaceJpaConflictClause<T>
-
conflictOnConstraintPaths
public SqmConflictClause<T> conflictOnConstraintPaths(Path<?>... paths)
Description copied from interface:JpaConflictClause- Specified by:
conflictOnConstraintPathsin interfaceJpaConflictClause<T>
-
conflictOnConstraintPaths
public SqmConflictClause<T> conflictOnConstraintPaths(List<? extends Path<?>> paths)
Description copied from interface:JpaConflictClauseSets the paths which are part of a unique constraint, for which a constraint violation is allowed.- Specified by:
conflictOnConstraintPathsin interfaceJpaConflictClause<T>
-
getConstraintPaths
public List<SqmPath<?>> getConstraintPaths()
Description copied from interface:JpaConflictClauseThe paths which are part of a unique constraint, for which a constraint violation is allowed.- Specified by:
getConstraintPathsin interfaceJpaConflictClause<T>
-
createConflictUpdateAction
public SqmConflictUpdateAction<T> createConflictUpdateAction()
Description copied from interface:JpaConflictClauseCreate a new conflict update action for this insert statement.- Specified by:
createConflictUpdateActionin interfaceJpaConflictClause<T>- Returns:
- a new conflict update action
- See Also:
JpaConflictClause.onConflictDo(JpaConflictUpdateAction)
-
getConflictAction
public @Nullable SqmConflictUpdateAction<T> getConflictAction()
Description copied from interface:JpaConflictClauseThe action to do when a conflict due to a unique constraint violation happens.- Specified by:
getConflictActionin interfaceJpaConflictClause<T>
-
onConflictDo
public JpaConflictClause<T> onConflictDo(JpaConflictUpdateAction<T> action)
Description copied from interface:JpaConflictClauseSets the action to do on a conflict. Settingnullmeans to do nothing.- Specified by:
onConflictDoin interfaceJpaConflictClause<T>- See Also:
JpaConflictClause.createConflictUpdateAction()
-
onConflictDoUpdate
public SqmConflictUpdateAction<T> onConflictDoUpdate()
Description copied from interface:JpaConflictClauseShorthand version for callingJpaConflictClause.onConflictDo(JpaConflictUpdateAction)withJpaConflictClause.createConflictUpdateAction()as argument and returning the update action.- Specified by:
onConflictDoUpdatein interfaceJpaConflictClause<T>
-
nodeBuilder
public NodeBuilder nodeBuilder()
- Specified by:
nodeBuilderin interfaceSqmNode
-
copy
public SqmConflictClause<T> copy(SqmCopyContext context)
-
accept
public <X> X accept(SemanticQueryWalker<X> walker)
Description copied from interface:SqmVisitableNodeAccept the walker per visitation- Specified by:
acceptin interfaceSqmVisitableNode
-
appendHqlString
public void appendHqlString(StringBuilder sb)
- Specified by:
appendHqlStringin interfaceSqmVisitableNode
-
-