Package org.hibernate.query.sqm.tree
Class AbstractSqmDmlStatement<E>
- java.lang.Object
-
- org.hibernate.query.sqm.tree.AbstractSqmNode
-
- org.hibernate.query.sqm.tree.AbstractSqmStatement<E>
-
- org.hibernate.query.sqm.tree.AbstractSqmDmlStatement<E>
-
- All Implemented Interfaces:
CommonAbstractCriteria
,Serializable
,JpaCriteriaBase
,JpaCriteriaNode
,JpaCteContainer
,JpaManipulationCriteria<E>
,JpaQueryableCriteria<E>
,ParameterCollector
,SqmCteContainer
,SqmDmlStatement<E>
,SqmNode
,SqmQuery<E>
,SqmStatement<E>
,SqmVisitableNode
- Direct Known Subclasses:
AbstractSqmInsertStatement
,AbstractSqmRestrictedDmlStatement
public abstract class AbstractSqmDmlStatement<E> extends AbstractSqmStatement<E> implements SqmDmlStatement<E>
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.query.sqm.tree.SqmStatement
SqmStatement.ParameterResolutions
-
-
Constructor Summary
Constructors Constructor Description AbstractSqmDmlStatement(NodeBuilder builder, SqmQuerySource querySource, Set<SqmParameter<?>> parameters, Map<String,SqmCteStatement<?>> cteStatements, SqmRoot<E> target)
AbstractSqmDmlStatement(SqmQuerySource querySource, NodeBuilder nodeBuilder)
AbstractSqmDmlStatement(SqmRoot<E> target, SqmQuerySource querySource, NodeBuilder nodeBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
appendHqlCteString(StringBuilder sb)
protected Map<String,SqmCteStatement<?>>
copyCteStatements(SqmCopyContext context)
<X> JpaCteCriteria<X>
getCteCriteria(String cteName)
Returns a CTE that is registered by the given name on this container, or any of its parents.Collection<? extends JpaCteCriteria<?>>
getCteCriterias()
Returns the CTEs that are registered on this container.SqmCteStatement<?>
getCteStatement(String cteLabel)
Collection<SqmCteStatement<?>>
getCteStatements()
SqmRoot<E>
getTarget()
Get the root path that is the target of the DML statement.void
setTarget(JpaRoot<E> root)
Set the root path<U> SqmSubQuery<U>
subquery(Class<U> type)
<X> JpaCteCriteria<X>
with(AbstractQuery<X> criteria)
Registers the givenCriteriaQuery
and returns aJpaCteCriteria
, which can be used for querying.<X> JpaCteCriteria<X>
with(String name, AbstractQuery<X> criteria)
LikeJpaCteContainer.with(AbstractQuery)
but assigns an explicit CTE name.<X> JpaCteCriteria<X>
withRecursiveUnionAll(AbstractQuery<X> baseCriteria, Function<JpaCteCriteria<X>,AbstractQuery<X>> recursiveCriteriaProducer)
Allows to register a recursive CTE.<X> JpaCteCriteria<X>
withRecursiveUnionAll(String name, AbstractQuery<X> baseCriteria, Function<JpaCteCriteria<X>,AbstractQuery<X>> recursiveCriteriaProducer)
LikeJpaCteContainer.withRecursiveUnionAll(AbstractQuery, Function)
but assigns an explicit CTE name.<X> JpaCteCriteria<X>
withRecursiveUnionDistinct(AbstractQuery<X> baseCriteria, Function<JpaCteCriteria<X>,AbstractQuery<X>> recursiveCriteriaProducer)
Allows to register a recursive CTE.<X> JpaCteCriteria<X>
withRecursiveUnionDistinct(String name, AbstractQuery<X> baseCriteria, Function<JpaCteCriteria<X>,AbstractQuery<X>> recursiveCriteriaProducer)
LikeJpaCteContainer.withRecursiveUnionDistinct(AbstractQuery, Function)
but assigns an explicit CTE name.-
Methods inherited from class org.hibernate.query.sqm.tree.AbstractSqmStatement
addParameter, copyParameters, getQuerySource, getSqmParameters, resolveParameters
-
Methods inherited from class org.hibernate.query.sqm.tree.AbstractSqmNode
nodeBuilder
-
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.JpaCriteriaBase
getRestriction
-
Methods inherited from interface org.hibernate.query.sqm.tree.SqmNode
asLoggableText, nodeBuilder
-
Methods inherited from interface org.hibernate.query.sqm.tree.SqmStatement
copy, getQuerySource, getSqmParameters, resolveParameters
-
Methods inherited from interface org.hibernate.query.sqm.tree.SqmVisitableNode
accept, appendHqlString, toHqlString
-
-
-
-
Constructor Detail
-
AbstractSqmDmlStatement
public AbstractSqmDmlStatement(SqmQuerySource querySource, NodeBuilder nodeBuilder)
-
AbstractSqmDmlStatement
public AbstractSqmDmlStatement(SqmRoot<E> target, SqmQuerySource querySource, NodeBuilder nodeBuilder)
-
AbstractSqmDmlStatement
public AbstractSqmDmlStatement(NodeBuilder builder, SqmQuerySource querySource, Set<SqmParameter<?>> parameters, Map<String,SqmCteStatement<?>> cteStatements, SqmRoot<E> target)
-
-
Method Detail
-
copyCteStatements
protected Map<String,SqmCteStatement<?>> copyCteStatements(SqmCopyContext context)
-
getCteStatements
public Collection<SqmCteStatement<?>> getCteStatements()
- Specified by:
getCteStatements
in interfaceSqmCteContainer
-
getCteStatement
public SqmCteStatement<?> getCteStatement(String cteLabel)
- Specified by:
getCteStatement
in interfaceSqmCteContainer
-
getCteCriterias
public Collection<? extends JpaCteCriteria<?>> getCteCriterias()
Description copied from interface:JpaCteContainer
Returns the CTEs that are registered on this container.- Specified by:
getCteCriterias
in interfaceJpaCteContainer
-
getCteCriteria
public <X> JpaCteCriteria<X> getCteCriteria(String cteName)
Description copied from interface:JpaCteContainer
Returns a CTE that is registered by the given name on this container, or any of its parents.- Specified by:
getCteCriteria
in interfaceJpaCteContainer
-
with
public <X> JpaCteCriteria<X> with(AbstractQuery<X> criteria)
Description copied from interface:JpaCteContainer
Registers the givenCriteriaQuery
and returns aJpaCteCriteria
, which can be used for querying.- Specified by:
with
in interfaceJpaCteContainer
- See Also:
JpaSelectCriteria.from(JpaCteCriteria)
,JpaFrom.join(JpaCteCriteria, SqmJoinType)
-
withRecursiveUnionAll
public <X> JpaCteCriteria<X> withRecursiveUnionAll(AbstractQuery<X> baseCriteria, Function<JpaCteCriteria<X>,AbstractQuery<X>> recursiveCriteriaProducer)
Description copied from interface:JpaCteContainer
Allows to register a recursive CTE. The baseCriteriaQuery
serves for the structure of theJpaCteCriteria
, which is made available in the recursive criteria producer function, so that the recursiveCriteriaQuery
is able to refer to the CTE again.- Specified by:
withRecursiveUnionAll
in interfaceJpaCteContainer
- See Also:
JpaSelectCriteria.from(JpaCteCriteria)
,JpaFrom.join(JpaCteCriteria, SqmJoinType)
-
withRecursiveUnionDistinct
public <X> JpaCteCriteria<X> withRecursiveUnionDistinct(AbstractQuery<X> baseCriteria, Function<JpaCteCriteria<X>,AbstractQuery<X>> recursiveCriteriaProducer)
Description copied from interface:JpaCteContainer
Allows to register a recursive CTE. The baseCriteriaQuery
serves for the structure of theJpaCteCriteria
, which is made available in the recursive criteria producer function, so that the recursiveCriteriaQuery
is able to refer to the CTE again.- Specified by:
withRecursiveUnionDistinct
in interfaceJpaCteContainer
- See Also:
JpaSelectCriteria.from(JpaCteCriteria)
,JpaFrom.join(JpaCteCriteria, SqmJoinType)
-
with
public <X> JpaCteCriteria<X> with(String name, AbstractQuery<X> criteria)
Description copied from interface:JpaCteContainer
LikeJpaCteContainer.with(AbstractQuery)
but assigns an explicit CTE name.- Specified by:
with
in interfaceJpaCteContainer
-
withRecursiveUnionAll
public <X> JpaCteCriteria<X> withRecursiveUnionAll(String name, AbstractQuery<X> baseCriteria, Function<JpaCteCriteria<X>,AbstractQuery<X>> recursiveCriteriaProducer)
Description copied from interface:JpaCteContainer
LikeJpaCteContainer.withRecursiveUnionAll(AbstractQuery, Function)
but assigns an explicit CTE name.- Specified by:
withRecursiveUnionAll
in interfaceJpaCteContainer
-
withRecursiveUnionDistinct
public <X> JpaCteCriteria<X> withRecursiveUnionDistinct(String name, AbstractQuery<X> baseCriteria, Function<JpaCteCriteria<X>,AbstractQuery<X>> recursiveCriteriaProducer)
Description copied from interface:JpaCteContainer
LikeJpaCteContainer.withRecursiveUnionDistinct(AbstractQuery, Function)
but assigns an explicit CTE name.- Specified by:
withRecursiveUnionDistinct
in interfaceJpaCteContainer
-
getTarget
public SqmRoot<E> getTarget()
Description copied from interface:SqmDmlStatement
Get the root path that is the target of the DML statement.- Specified by:
getTarget
in interfaceJpaManipulationCriteria<E>
- Specified by:
getTarget
in interfaceSqmDmlStatement<E>
-
setTarget
public void setTarget(JpaRoot<E> root)
Description copied from interface:SqmDmlStatement
Set the root path- Specified by:
setTarget
in interfaceJpaManipulationCriteria<E>
- Specified by:
setTarget
in interfaceSqmDmlStatement<E>
-
subquery
public <U> SqmSubQuery<U> subquery(Class<U> type)
- Specified by:
subquery
in interfaceCommonAbstractCriteria
- Specified by:
subquery
in interfaceJpaCriteriaBase
-
appendHqlCteString
protected void appendHqlCteString(StringBuilder sb)
-
-