use of com.blazebit.persistence.impl.query.CustomReturningSQLTypedQuery in project blaze-persistence by Blazebit.
the class AbstractDeleteCollectionCriteriaBuilder method getExecuteWithReturningQuery.
@Override
protected <R> TypedQuery<ReturningResult<R>> getExecuteWithReturningQuery(TypedQuery<Object[]> exampleQuery, Query baseQuery, String[] returningColumns, ReturningObjectBuilder<R> objectBuilder) {
if (collectionAttribute.getJoinTable() == null) {
return super.getExecuteWithReturningQuery(exampleQuery, baseQuery, returningColumns, objectBuilder);
} else {
QuerySpecification querySpecification = getQuerySpecification(baseQuery, exampleQuery, returningColumns, objectBuilder, null);
CustomReturningSQLTypedQuery query = new CustomReturningSQLTypedQuery<R>(querySpecification, exampleQuery, parameterManager.getCriteriaNameMapping(), parameterManager.getTransformers(), parameterManager.getValuesParameters(), parameterManager.getValuesBinders());
parameterManager.parameterizeQuery(query);
return query;
}
}
use of com.blazebit.persistence.impl.query.CustomReturningSQLTypedQuery in project blaze-persistence by Blazebit.
the class AbstractModificationCriteriaBuilder method getExecuteWithReturningQuery.
protected <R> TypedQuery<ReturningResult<R>> getExecuteWithReturningQuery(TypedQuery<Object[]> exampleQuery, Query baseQuery, String[] returningColumns, ReturningObjectBuilder<R> objectBuilder) {
Set<String> parameterListNames = parameterManager.getParameterListNames(baseQuery);
boolean shouldRenderCteNodes = renderCteNodes(false);
List<CTENode> ctes = shouldRenderCteNodes ? getCteNodes(false) : Collections.EMPTY_LIST;
QuerySpecification querySpecification = new ModificationQuerySpecification(this, baseQuery, exampleQuery, parameterManager.getParameterImpls(), parameterListNames, mainQuery.cteManager.isRecursive(), ctes, shouldRenderCteNodes, false, returningColumns, objectBuilder, null, returningAttributeBindingMap, mainQuery.getQueryConfiguration().isQueryPlanCacheEnabled());
CustomReturningSQLTypedQuery query = new CustomReturningSQLTypedQuery<R>(querySpecification, exampleQuery, parameterManager.getCriteriaNameMapping(), parameterManager.getTransformers(), parameterManager.getValuesParameters(), parameterManager.getValuesBinders());
query.setFirstResult(firstResult);
query.setMaxResults(maxResults);
parameterManager.parameterizeQuery(query);
return query;
}
use of com.blazebit.persistence.impl.query.CustomReturningSQLTypedQuery in project blaze-persistence by Blazebit.
the class AbstractUpdateCollectionCriteriaBuilder method getExecuteWithReturningQuery.
@Override
protected <R> TypedQuery<ReturningResult<R>> getExecuteWithReturningQuery(TypedQuery<Object[]> exampleQuery, Query baseQuery, String[] returningColumns, ReturningObjectBuilder<R> objectBuilder) {
if (collectionAttribute.getJoinTable() == null) {
return super.getExecuteWithReturningQuery(exampleQuery, baseQuery, returningColumns, objectBuilder);
} else {
QuerySpecification querySpecification = getQuerySpecification(baseQuery, exampleQuery, returningColumns, objectBuilder, null);
CustomReturningSQLTypedQuery query = new CustomReturningSQLTypedQuery<R>(querySpecification, exampleQuery, parameterManager.getCriteriaNameMapping(), parameterManager.getTransformers(), parameterManager.getValuesParameters(), parameterManager.getValuesBinders());
parameterManager.parameterizeQuery(query);
return query;
}
}
use of com.blazebit.persistence.impl.query.CustomReturningSQLTypedQuery in project blaze-persistence by Blazebit.
the class BaseUpdateCriteriaBuilderImpl method getExecuteWithReturningQuery.
@Override
protected <R> TypedQuery<ReturningResult<R>> getExecuteWithReturningQuery(TypedQuery<Object[]> exampleQuery, Query baseQuery, String[] returningColumns, ReturningObjectBuilder<R> objectBuilder) {
QuerySpecification querySpecification = getQuerySpecification(baseQuery, exampleQuery, returningColumns, objectBuilder, null);
CustomReturningSQLTypedQuery<R> query = new CustomReturningSQLTypedQuery<R>(querySpecification, exampleQuery, parameterManager.getCriteriaNameMapping(), parameterManager.getTransformers(), parameterManager.getValuesParameters(), parameterManager.getValuesBinders());
query.setFirstResult(firstResult);
query.setMaxResults(maxResults);
parameterManager.parameterizeQuery(query);
return query;
}
use of com.blazebit.persistence.impl.query.CustomReturningSQLTypedQuery in project blaze-persistence by Blazebit.
the class BaseDeleteCriteriaBuilderImpl method getExecuteWithReturningQuery.
@Override
protected <R> TypedQuery<ReturningResult<R>> getExecuteWithReturningQuery(TypedQuery<Object[]> exampleQuery, Query baseQuery, String[] returningColumns, ReturningObjectBuilder<R> objectBuilder) {
QuerySpecification querySpecification = getQuerySpecification(baseQuery, exampleQuery, returningColumns, objectBuilder, null);
CustomReturningSQLTypedQuery<R> query = new CustomReturningSQLTypedQuery<R>(querySpecification, exampleQuery, parameterManager.getCriteriaNameMapping(), parameterManager.getTransformers(), parameterManager.getValuesParameters(), parameterManager.getValuesBinders());
query.setFirstResult(firstResult);
query.setMaxResults(maxResults);
parameterManager.parameterizeQuery(query);
return query;
}
Aggregations