HHH-12685 Convert the parameters to JPQL ones before calling isBound()

This commit is contained in:
Guillaume Smet 2018-06-13 11:11:33 +02:00
parent 07738c4d89
commit 27409b27a3
1 changed files with 10 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Stream;
import javax.persistence.FlushModeType;
import javax.persistence.LockModeType;
import javax.persistence.Parameter;
@ -332,7 +333,15 @@ public class CriteriaQueryTypeQueryAdapter<X> implements QueryImplementor<X> {
@Override
public boolean isBound(Parameter<?> param) {
entityManager.checkOpen( false );
return jpqlQuery.isBound( param );
final ExplicitParameterInfo<?> parameterInfo = resolveParameterInfo( param );
Parameter<?> jpqlParameter;
if ( parameterInfo.isNamed() ) {
jpqlParameter = jpqlQuery.getParameter( parameterInfo.getName() );
}
else {
jpqlParameter = jpqlQuery.getParameter( parameterInfo.getPosition() );
}
return jpqlQuery.isBound( jpqlParameter );
}
@Override