diff --git a/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/InformixDialectTestCase.java b/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/InformixDialectTestCase.java index 80f6268f6c..4adf00e07f 100644 --- a/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/InformixDialectTestCase.java +++ b/hibernate-community-dialects/src/test/java/org/hibernate/community/dialect/InformixDialectTestCase.java @@ -9,6 +9,8 @@ package org.hibernate.community.dialect; import java.util.Collections; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.engine.query.internal.NativeQueryInterpreterStandardImpl; +import org.hibernate.engine.query.spi.NativeQueryInterpreter; import org.hibernate.metamodel.model.domain.internal.JpaMetamodelImpl; import org.hibernate.orm.test.jpa.JpaComplianceStub; import org.hibernate.query.criteria.ValueHandlingMode; @@ -57,7 +59,7 @@ public class InformixDialectTestCase extends BaseUnitTestCase { dialect.getPreferredSqlTypeCodeForBoolean(), false, new NamedObjectRepositoryImpl( Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap() ), - null, + NativeQueryInterpreterStandardImpl.NATIVE_QUERY_INTERPRETER, dialect, ssr ); diff --git a/hibernate-core/src/main/java/org/hibernate/query/spi/QueryEngine.java b/hibernate-core/src/main/java/org/hibernate/query/spi/QueryEngine.java index 551191189d..7266f468ae 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/spi/QueryEngine.java +++ b/hibernate-core/src/main/java/org/hibernate/query/spi/QueryEngine.java @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.function.Supplier; import org.hibernate.Incubating; @@ -137,9 +138,9 @@ public class QueryEngine { Dialect dialect, SqmFunctionRegistry userDefinedRegistry, ServiceRegistry serviceRegistry) { - this.namedObjectRepository = namedObjectRepository; + this.namedObjectRepository = Objects.requireNonNull( namedObjectRepository ); this.sqmTranslatorFactory = sqmTranslatorFactory; - this.nativeQueryInterpreter = nativeQueryInterpreter; + this.nativeQueryInterpreter = Objects.requireNonNull( nativeQueryInterpreter ); this.interpretationCache = interpretationCache; this.hqlTranslator = hqlTranslator; @@ -202,9 +203,9 @@ public class QueryEngine { NativeQueryInterpreter nativeQueryInterpreter, Dialect dialect, ServiceRegistry serviceRegistry) { - this.namedObjectRepository = namedObjectRepository; + this.namedObjectRepository = Objects.requireNonNull( namedObjectRepository ); this.sqmTranslatorFactory = null; - this.nativeQueryInterpreter = nativeQueryInterpreter; + this.nativeQueryInterpreter = Objects.requireNonNull( nativeQueryInterpreter ); this.sqmFunctionRegistry = new SqmFunctionRegistry(); this.typeConfiguration = jpaMetamodel.getTypeConfiguration();