reset the ValueHandlingMode after pagination
This commit is contained in:
parent
9f91f2dbff
commit
6d4002bd97
|
@ -17,6 +17,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hibernate.Internal;
|
||||
import org.hibernate.jpa.spi.JpaCompliance;
|
||||
import org.hibernate.metamodel.model.domain.JpaMetamodel;
|
||||
import org.hibernate.query.ImmutableEntityUpdateQueryHandlingMode;
|
||||
|
@ -89,7 +90,8 @@ public interface NodeBuilder extends HibernateCriteriaBuilder, BindingContext {
|
|||
|
||||
QueryEngine getQueryEngine();
|
||||
|
||||
void setCriteriaValueHandlingMode(ValueHandlingMode criteriaValueHandlingMode);
|
||||
@Internal
|
||||
ValueHandlingMode setCriteriaValueHandlingMode(ValueHandlingMode criteriaValueHandlingMode);
|
||||
|
||||
<R> SqmTuple<R> tuple(
|
||||
Class<R> tupleType,
|
||||
|
|
|
@ -166,8 +166,13 @@ abstract class AbstractSqmSelectionQuery<R> extends AbstractSelectionQuery<R> {
|
|||
getSqmSelectStatement().copy( noParamCopyContext() );
|
||||
final NodeBuilder builder = sqm.nodeBuilder();
|
||||
//TODO: find a better way handle parameters
|
||||
builder.setCriteriaValueHandlingMode(ValueHandlingMode.INLINE);
|
||||
return paginate( keyDefinition, keyValues, sqm, builder );
|
||||
final ValueHandlingMode valueHandlingMode = builder.setCriteriaValueHandlingMode(ValueHandlingMode.INLINE);
|
||||
try {
|
||||
return paginate( keyDefinition, keyValues, sqm, builder );
|
||||
}
|
||||
finally {
|
||||
builder.setCriteriaValueHandlingMode( valueHandlingMode );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -241,8 +241,11 @@ public class SqmCriteriaNodeBuilder implements NodeBuilder, SqmCreationContext,
|
|||
}
|
||||
}
|
||||
|
||||
public void setCriteriaValueHandlingMode(ValueHandlingMode criteriaValueHandlingMode) {
|
||||
@Override
|
||||
public ValueHandlingMode setCriteriaValueHandlingMode(ValueHandlingMode criteriaValueHandlingMode) {
|
||||
ValueHandlingMode current = this.criteriaValueHandlingMode;
|
||||
this.criteriaValueHandlingMode = criteriaValueHandlingMode;
|
||||
return current;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue