reset the ValueHandlingMode after pagination
This commit is contained in:
parent
da0b01f1e8
commit
63dde7dc09
|
@ -17,6 +17,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hibernate.Internal;
|
||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||
import org.hibernate.metamodel.model.domain.JpaMetamodel;
|
||||
import org.hibernate.query.NullPrecedence;
|
||||
|
@ -86,7 +87,8 @@ public interface NodeBuilder extends HibernateCriteriaBuilder {
|
|||
|
||||
QueryEngine getQueryEngine();
|
||||
|
||||
void setCriteriaValueHandlingMode(ValueHandlingMode criteriaValueHandlingMode);
|
||||
@Internal
|
||||
ValueHandlingMode setCriteriaValueHandlingMode(ValueHandlingMode criteriaValueHandlingMode);
|
||||
|
||||
<R> SqmTuple<R> tuple(
|
||||
Class<R> tupleType,
|
||||
|
|
|
@ -166,9 +166,14 @@ 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);
|
||||
final ValueHandlingMode valueHandlingMode = builder.setCriteriaValueHandlingMode(ValueHandlingMode.INLINE);
|
||||
try {
|
||||
return paginate( keyDefinition, keyValues, sqm, builder );
|
||||
}
|
||||
finally {
|
||||
builder.setCriteriaValueHandlingMode( valueHandlingMode );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
|
|
|
@ -228,8 +228,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