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> X
accept(SemanticQueryWalker<X> walker)
Accept the walker per visitationvoid
appendHqlString(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 String
getConstraintName()
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.NodeBuilder
nodeBuilder()
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:JpaConflictClause
The excluded row/object which was not inserted.- Specified by:
getExcludedRoot
in interfaceJpaConflictClause<T>
-
getConstraintName
public @Nullable String getConstraintName()
Description copied from interface:JpaConflictClause
The unique constraint name for which a constraint violation is allowed.- Specified by:
getConstraintName
in interfaceJpaConflictClause<T>
-
conflictOnConstraint
public SqmConflictClause<T> conflictOnConstraint(@Nullable String constraintName)
Description copied from interface:JpaConflictClause
Sets the unique constraint name for which a constraint violation is allowed.- Specified by:
conflictOnConstraint
in interfaceJpaConflictClause<T>
-
conflictOnConstraintAttributes
public JpaConflictClause<T> conflictOnConstraintAttributes(String... attributes)
Description copied from interface:JpaConflictClause
Shorthand for callingJpaConflictClause.conflictOnConstraintPaths(List)
with paths resolved for the given attributes against the insert target.- Specified by:
conflictOnConstraintAttributes
in interfaceJpaConflictClause<T>
-
conflictOnConstraintAttributes
public JpaConflictClause<T> conflictOnConstraintAttributes(SingularAttribute<T,?>... attributes)
Description copied from interface:JpaConflictClause
Shorthand for callingJpaConflictClause.conflictOnConstraintPaths(List)
with paths resolved for the given attributes against the insert target.- Specified by:
conflictOnConstraintAttributes
in interfaceJpaConflictClause<T>
-
conflictOnConstraintPaths
public SqmConflictClause<T> conflictOnConstraintPaths(Path<?>... paths)
Description copied from interface:JpaConflictClause
- Specified by:
conflictOnConstraintPaths
in interfaceJpaConflictClause<T>
-
conflictOnConstraintPaths
public SqmConflictClause<T> conflictOnConstraintPaths(List<? extends Path<?>> paths)
Description copied from interface:JpaConflictClause
Sets the paths which are part of a unique constraint, for which a constraint violation is allowed.- Specified by:
conflictOnConstraintPaths
in interfaceJpaConflictClause<T>
-
getConstraintPaths
public List<SqmPath<?>> getConstraintPaths()
Description copied from interface:JpaConflictClause
The paths which are part of a unique constraint, for which a constraint violation is allowed.- Specified by:
getConstraintPaths
in interfaceJpaConflictClause<T>
-
createConflictUpdateAction
public SqmConflictUpdateAction<T> createConflictUpdateAction()
Description copied from interface:JpaConflictClause
Create a new conflict update action for this insert statement.- Specified by:
createConflictUpdateAction
in interfaceJpaConflictClause<T>
- Returns:
- a new conflict update action
- See Also:
JpaConflictClause.onConflictDo(JpaConflictUpdateAction)
-
getConflictAction
public @Nullable SqmConflictUpdateAction<T> getConflictAction()
Description copied from interface:JpaConflictClause
The action to do when a conflict due to a unique constraint violation happens.- Specified by:
getConflictAction
in interfaceJpaConflictClause<T>
-
onConflictDo
public JpaConflictClause<T> onConflictDo(JpaConflictUpdateAction<T> action)
Description copied from interface:JpaConflictClause
Sets the action to do on a conflict. Settingnull
means to do nothing.- Specified by:
onConflictDo
in interfaceJpaConflictClause<T>
- See Also:
JpaConflictClause.createConflictUpdateAction()
-
onConflictDoUpdate
public SqmConflictUpdateAction<T> onConflictDoUpdate()
Description copied from interface:JpaConflictClause
Shorthand version for callingJpaConflictClause.onConflictDo(JpaConflictUpdateAction)
withJpaConflictClause.createConflictUpdateAction()
as argument and returning the update action.- Specified by:
onConflictDoUpdate
in interfaceJpaConflictClause<T>
-
nodeBuilder
public NodeBuilder nodeBuilder()
- Specified by:
nodeBuilder
in interfaceSqmNode
-
copy
public SqmConflictClause<T> copy(SqmCopyContext context)
-
accept
public <X> X accept(SemanticQueryWalker<X> walker)
Description copied from interface:SqmVisitableNode
Accept the walker per visitation- Specified by:
accept
in interfaceSqmVisitableNode
-
appendHqlString
public void appendHqlString(StringBuilder sb)
- Specified by:
appendHqlString
in interfaceSqmVisitableNode
-
-