From 473c0c6cf41e20487c6b2bbd5c36daec4385873e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Wed, 20 Jul 2022 10:23:32 +0200 Subject: [PATCH 1/8] Simplify code dealing with all persistence units in Hibernate Search extension --- ...HibernateSearchElasticsearchProcessor.java | 12 ++++++------ ...ateSearchElasticsearchBuildTimeConfig.java | 13 ++++++++++++- .../HibernateSearchElasticsearchRecorder.java | 19 ++++++------------- ...rnateSearchElasticsearchRuntimeConfig.java | 10 ++++++++++ 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java index 13d5ba3071975..849cbfde57bf2 100644 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java @@ -104,6 +104,9 @@ public void build(HibernateSearchElasticsearchRecorder recorder, Map>> persistenceUnitAndBackendAndIndexNamesForSearchExtensions = collectPersistenceUnitAndBackendAndIndexNamesForSearchExtensions( index); + Map configByPU = buildTimeConfig + .getAllPersistenceUnitConfigsAsMap(); + for (PersistenceUnitDescriptorBuildItem puDescriptor : persistenceUnitDescriptorBuildItems) { Collection indexedAnnotationsForPU = new ArrayList<>(); for (AnnotationInstance indexedAnnotation : indexedAnnotations) { @@ -114,7 +117,8 @@ public void build(HibernateSearchElasticsearchRecorder recorder, } Map> backendAndIndexNamesForSearchExtensions = persistenceUnitAndBackendAndIndexNamesForSearchExtensions .getOrDefault(puDescriptor.getPersistenceUnitName(), Collections.emptyMap()); - buildForPersistenceUnit(recorder, indexedAnnotationsForPU, puDescriptor.getPersistenceUnitName(), + String puName = puDescriptor.getPersistenceUnitName(); + buildForPersistenceUnit(recorder, indexedAnnotationsForPU, puName, configByPU.get(puName), backendAndIndexNamesForSearchExtensions, configuredPersistenceUnits, staticIntegrations, runtimeIntegrations); } @@ -142,6 +146,7 @@ public static Map>> collectPersistenceUnitAndBac private void buildForPersistenceUnit(HibernateSearchElasticsearchRecorder recorder, Collection indexedAnnotationsForPU, String persistenceUnitName, + HibernateSearchElasticsearchBuildTimeConfigPersistenceUnit puConfig, Map> backendAndIndexNamesForSearchExtensions, BuildProducer configuredPersistenceUnits, BuildProducer staticIntegrations, @@ -157,11 +162,6 @@ private void buildForPersistenceUnit(HibernateSearchElasticsearchRecorder record return; } - HibernateSearchElasticsearchBuildTimeConfigPersistenceUnit puConfig = PersistenceUnitUtil - .isDefaultPersistenceUnit(persistenceUnitName) - ? buildTimeConfig.defaultPersistenceUnit - : buildTimeConfig.persistenceUnits.get(persistenceUnitName); - boolean defaultBackendIsUsed = false; for (AnnotationInstance indexedAnnotation : indexedAnnotationsForPU) { if (indexedAnnotation.value("backend") == null) { diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchBuildTimeConfig.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchBuildTimeConfig.java index f412d7ed0f5a4..621d075ff2b4a 100644 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchBuildTimeConfig.java +++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchBuildTimeConfig.java @@ -1,7 +1,9 @@ package io.quarkus.hibernate.search.orm.elasticsearch.runtime; import java.util.Map; +import java.util.TreeMap; +import io.quarkus.hibernate.orm.runtime.PersistenceUnitUtil; import io.quarkus.runtime.annotations.ConfigDocMapKey; import io.quarkus.runtime.annotations.ConfigDocSection; import io.quarkus.runtime.annotations.ConfigItem; @@ -23,6 +25,15 @@ public class HibernateSearchElasticsearchBuildTimeConfig { @ConfigDocSection @ConfigDocMapKey("persistence-unit-name") @ConfigItem(name = ConfigItem.PARENT) - public Map persistenceUnits; + Map persistenceUnits; + + public Map getAllPersistenceUnitConfigsAsMap() { + Map map = new TreeMap<>(); + if (defaultPersistenceUnit != null) { + map.put(PersistenceUnitUtil.DEFAULT_PERSISTENCE_UNIT_NAME, defaultPersistenceUnit); + } + map.putAll(persistenceUnits); + return map; + } } diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java index 4fcbc114f8180..9081f1a45d53a 100644 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java +++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java @@ -40,7 +40,6 @@ import org.hibernate.search.util.common.reflect.spi.ValueReadHandleFactory; import io.quarkus.arc.Arc; -import io.quarkus.hibernate.orm.runtime.PersistenceUnitUtil; import io.quarkus.hibernate.orm.runtime.integration.HibernateOrmIntegrationRuntimeInitListener; import io.quarkus.hibernate.orm.runtime.integration.HibernateOrmIntegrationStaticInitListener; import io.quarkus.hibernate.search.orm.elasticsearch.runtime.HibernateSearchElasticsearchBuildTimeConfigPersistenceUnit.ElasticsearchBackendBuildTimeConfig; @@ -69,7 +68,8 @@ public HibernateOrmIntegrationRuntimeInitListener createRuntimeInitListener( HibernateSearchElasticsearchRuntimeConfig runtimeConfig, String persistenceUnitName, Map> backendAndIndexNamesForSearchExtensions, List integrationRuntimeInitListeners) { - HibernateSearchElasticsearchRuntimeConfigPersistenceUnit puConfig = runtimePuConfig(runtimeConfig, persistenceUnitName); + HibernateSearchElasticsearchRuntimeConfigPersistenceUnit puConfig = runtimeConfig.getAllPersistenceUnitConfigsAsMap() + .get(persistenceUnitName); return new HibernateSearchIntegrationRuntimeInitListener(persistenceUnitName, puConfig, backendAndIndexNamesForSearchExtensions, integrationRuntimeInitListeners); } @@ -84,8 +84,8 @@ public Supplier searchMappingSupplier(HibernateSearchElasticsearc return new Supplier() { @Override public SearchMapping get() { - HibernateSearchElasticsearchRuntimeConfigPersistenceUnit config = runtimePuConfig(runtimeConfig, - persistenceUnitName); + HibernateSearchElasticsearchRuntimeConfigPersistenceUnit config = runtimeConfig + .getAllPersistenceUnitConfigsAsMap().get(persistenceUnitName); if (config != null && !config.enabled) { throw new IllegalStateException( "Cannot retrieve the SearchMapping: Hibernate Search was disabled through configuration properties"); @@ -107,8 +107,8 @@ public Supplier searchSessionSupplier(HibernateSearchElasticsearc return new Supplier() { @Override public SearchSession get() { - HibernateSearchElasticsearchRuntimeConfigPersistenceUnit config = runtimePuConfig(runtimeConfig, - persistenceUnitName); + HibernateSearchElasticsearchRuntimeConfigPersistenceUnit config = runtimeConfig + .getAllPersistenceUnitConfigsAsMap().get(persistenceUnitName); if (config != null && !config.enabled) { throw new IllegalStateException( "Cannot retrieve the SearchSession: Hibernate Search was disabled through configuration properties"); @@ -125,13 +125,6 @@ public SearchSession get() { }; } - private HibernateSearchElasticsearchRuntimeConfigPersistenceUnit runtimePuConfig( - HibernateSearchElasticsearchRuntimeConfig runtimeConfig, String persistenceUnitName) { - return PersistenceUnitUtil.isDefaultPersistenceUnit(persistenceUnitName) - ? runtimeConfig.defaultPersistenceUnit - : runtimeConfig.persistenceUnits.get(persistenceUnitName); - } - private static final class HibernateSearchIntegrationDisabledListener implements HibernateOrmIntegrationStaticInitListener { private HibernateSearchIntegrationDisabledListener() { diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java index 599c77ed73693..c85213fe9d2ad 100644 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java +++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java @@ -1,6 +1,7 @@ package io.quarkus.hibernate.search.orm.elasticsearch.runtime; import java.util.Map; +import java.util.TreeMap; import io.quarkus.hibernate.orm.runtime.PersistenceUnitUtil; import io.quarkus.runtime.annotations.ConfigDocMapKey; @@ -26,6 +27,15 @@ public class HibernateSearchElasticsearchRuntimeConfig { @ConfigItem(name = ConfigItem.PARENT) public Map persistenceUnits; + public Map getAllPersistenceUnitConfigsAsMap() { + Map map = new TreeMap<>(); + if (defaultPersistenceUnit != null) { + map.put(PersistenceUnitUtil.DEFAULT_PERSISTENCE_UNIT_NAME, defaultPersistenceUnit); + } + map.putAll(persistenceUnits); + return map; + } + public static String elasticsearchVersionPropertyKey(String persistenceUnitName, String backendName) { return backendPropertyKey(persistenceUnitName, backendName, null, "version"); } From 5f41eced084cb5e201de125d12fc852d4c3ee7d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Wed, 20 Jul 2022 10:41:16 +0200 Subject: [PATCH 2/8] Don't set the H2 dialect in Hibernate ORM tests 1. Because that's not necessary: if the db-kind is set to H2 in the datasource, we'll use the H2 dialect automatically. 2. Because that's harmful: we don't want to use the "vanilla" H2 dialect, but a custom, Quarkus-specific version. See QuarkusH2Dialect. --- docs/src/main/asciidoc/hibernate-orm.adoc | 1 - .../main/asciidoc/hibernate-search-orm-elasticsearch.adoc | 2 -- ...on-default-pu-explicit-unconfigured-datasource.properties | 1 - ...nator-ignore-explicit-for-joined-default-value.properties | 2 -- ...iminator-ignore-explicit-for-joined-true-value.properties | 1 - .../resources/application-fetch-max-depth-zero.properties | 1 - .../test/resources/application-generate-script.properties | 1 - .../test/resources/application-generation-none.properties | 1 - .../application-implicit-naming-strategy.properties | 1 - .../resources/application-import-load-script-test.properties | 1 - .../application-import-multiple-load-scripts-test.properties | 1 - .../resources/application-invalid-multiline-test.properties | 1 - .../application-log-sql-format-sql-default.properties | 1 - .../application-log-sql-format-sql-false.properties | 1 - .../application-mapping-files-my-hbm-xml.properties | 1 - .../application-mapping-files-my-orm-xml.properties | 1 - .../resources/application-mapping-files-no-file.properties | 1 - .../application-metadata-builder-contributor.properties | 1 - .../test/resources/application-metrics-enabled.properties | 1 - ...ication-multiple-persistence-units-annotations.properties | 4 +--- ...multiple-persistence-units-unaffected-entities.properties | 1 - ...-multiple-persistence-units-undefined-packages.properties | 1 - .../application-multiple-persistence-units.properties | 3 --- ...nator-ignore-explicit-for-joined-default-value.properties | 2 -- ...iminator-ignore-explicit-for-joined-true-value.properties | 2 -- .../test/resources/application-named-datasource.properties | 1 - ...tion-named-pu-explicit-unconfigured-datasource.properties | 1 - .../resources/application-named-pu-no-datasource.properties | 3 ++- .../resources/application-no-file-option-test.properties | 1 - ...application-ormxml-annotationoverride-disabled.properties | 1 - .../application-ormxml-annotationoverride-enabled.properties | 1 - .../resources/application-other-load-script-test.properties | 1 - .../application-physical-naming-strategy.properties | 1 - .../test/resources/application-quoted-identifiers.properties | 1 - .../deployment/src/test/resources/application.properties | 1 - .../application-multiple-persistence-units.properties | 3 +-- .../deployment/src/test/resources/application.properties | 1 - .../application-multiple-persistence-units.properties | 5 +---- .../test/resources/application-nohsearchconfig.properties | 1 - .../src/test/resources/application-start-offline.properties | 1 - .../deployment/src/test/resources/application.properties | 1 - ...plication-erroneous-multiple-persistence-units.properties | 2 -- .../application-multiple-persistence-units.properties | 2 -- .../src/test/resources/application-test.properties | 1 - .../src/test/resources/application-commented-out.properties | 1 - ...plication-erroneous-multiple-persistence-units.properties | 2 -- ...tion-multiple-persistence-units-for-repository.properties | 2 -- .../application-multiple-persistence-units.properties | 2 -- .../src/test/resources/application-test.properties | 1 - .../deployment/src/test/resources/application.properties | 1 - .../deployment/src/test/resources/application.properties | 1 - .../deployment/src/test/resources/application.properties | 1 - .../deployment/src/test/resources/application.properties | 1 - .../cache/src/main/resources/application.properties | 1 - .../src/main/resources/application.properties | 1 - .../grpc-hibernate/src/main/resources/application.properties | 1 - .../src/main/resources/application.properties | 1 - .../src/main/resources/application.properties | 1 - .../src/main/resources/application.properties | 1 - .../src/main/resources/ddlgeneration.properties | 1 - .../src/main/resources/nopaging.properties | 1 - .../src/main/resources/application.properties | 1 - .../src/main/resources/application.properties | 1 - .../src/main/resources/application.properties | 1 - .../modern-app/src/main/resources/application.properties | 5 ----- .../jpa/src/main/resources/application.properties | 1 - .../src/main/resources/application.properties | 1 - .../qute/src/main/resources/application.properties | 1 - .../src/test/resources/application.properties | 1 - .../src/main/resources/application.properties | 1 - 70 files changed, 5 insertions(+), 91 deletions(-) diff --git a/docs/src/main/asciidoc/hibernate-orm.adoc b/docs/src/main/asciidoc/hibernate-orm.adoc index 50bf0edf97f98..04d4853c9619b 100644 --- a/docs/src/main/asciidoc/hibernate-orm.adoc +++ b/docs/src/main/asciidoc/hibernate-orm.adoc @@ -214,7 +214,6 @@ For instance, the following snippet defines a default datasource and a default p quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:default;DB_CLOSE_DELAY=-1 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create ---- diff --git a/docs/src/main/asciidoc/hibernate-search-orm-elasticsearch.adoc b/docs/src/main/asciidoc/hibernate-search-orm-elasticsearch.adoc index a5aec9283e4fb..f762133986557 100644 --- a/docs/src/main/asciidoc/hibernate-search-orm-elasticsearch.adoc +++ b/docs/src/main/asciidoc/hibernate-search-orm-elasticsearch.adoc @@ -720,8 +720,6 @@ and sets the Elasticsearch host for that persistence unit to `es1.mycompany.com: quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:default;DB_CLOSE_DELAY=-1 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect - quarkus.hibernate-search-orm.elasticsearch.hosts=es1.mycompany.com:9200 quarkus.hibernate-search-orm.elasticsearch.version=7 ---- diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-default-pu-explicit-unconfigured-datasource.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-default-pu-explicit-unconfigured-datasource.properties index e58931ad3deb0..6bc5049280142 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-default-pu-explicit-unconfigured-datasource.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-default-pu-explicit-unconfigured-datasource.properties @@ -1,4 +1,3 @@ quarkus.hibernate-orm.datasource=ds-1 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-discriminator-ignore-explicit-for-joined-default-value.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-discriminator-ignore-explicit-for-joined-default-value.properties index 3b9963b7c82a0..1267a39fad832 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-discriminator-ignore-explicit-for-joined-default-value.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-discriminator-ignore-explicit-for-joined-default-value.properties @@ -1,4 +1,2 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test - -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-discriminator-ignore-explicit-for-joined-true-value.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-discriminator-ignore-explicit-for-joined-true-value.properties index f39a8585988f4..fb6fdbd70a398 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-discriminator-ignore-explicit-for-joined-true-value.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-discriminator-ignore-explicit-for-joined-true-value.properties @@ -1,5 +1,4 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.discriminator.ignore-explicit-for-joined=true \ No newline at end of file diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-fetch-max-depth-zero.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-fetch-max-depth-zero.properties index 89f9e991f3d1d..c11135c410f27 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-fetch-max-depth-zero.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-fetch-max-depth-zero.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-generate-script.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-generate-script.properties index cc67753d9841b..7fdb9b3e63f0c 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-generate-script.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-generate-script.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-generation-none.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-generation-none.properties index caf5f3fa9d0ee..f6558adf46216 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-generation-none.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-generation-none.properties @@ -1,6 +1,5 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=none diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-implicit-naming-strategy.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-implicit-naming-strategy.properties index 19707f2a9980a..fa0557afc7a38 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-implicit-naming-strategy.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-implicit-naming-strategy.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.implicit-naming-strategy=io.quarkus.hibernate.orm.naming.CustomImplicitNamingStrategy \ No newline at end of file diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-import-load-script-test.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-import-load-script-test.properties index 529c2de9800df..d5c3b62715654 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-import-load-script-test.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-import-load-script-test.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.sql-load-script=import.sql diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-import-multiple-load-scripts-test.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-import-multiple-load-scripts-test.properties index fae1327b9edc8..f3696f011e566 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-import-multiple-load-scripts-test.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-import-multiple-load-scripts-test.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.sql-load-script=import-1.sql,import-2.sql diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-invalid-multiline-test.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-invalid-multiline-test.properties index 9df9c5e4a4e7f..681039b672f66 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-invalid-multiline-test.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-invalid-multiline-test.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.database.generation.halt-on-error=true diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-log-sql-format-sql-default.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-log-sql-format-sql-default.properties index 3aa079f071a1a..f873b8e59b71a 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-log-sql-format-sql-default.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-log-sql-format-sql-default.properties @@ -1,5 +1,4 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.log.sql=true diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-log-sql-format-sql-false.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-log-sql-format-sql-false.properties index baded1c2c3889..b2736e2664325 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-log-sql-format-sql-false.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-log-sql-format-sql-false.properties @@ -1,6 +1,5 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.log.format-sql=false diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-mapping-files-my-hbm-xml.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-mapping-files-my-hbm-xml.properties index d29ddf05ea173..c8f411814b63c 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-mapping-files-my-hbm-xml.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-mapping-files-my-hbm-xml.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.mapping-files=my-hbm.xml diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-mapping-files-my-orm-xml.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-mapping-files-my-orm-xml.properties index a25dcb98b4379..b31afdd838e22 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-mapping-files-my-orm-xml.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-mapping-files-my-orm-xml.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.mapping-files=my-orm.xml diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-mapping-files-no-file.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-mapping-files-no-file.properties index d29b3d643fddc..c3127a629ee19 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-mapping-files-no-file.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-mapping-files-no-file.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.mapping-files=no-file diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-metadata-builder-contributor.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-metadata-builder-contributor.properties index 4f8b1c81bb18d..c7c0fbe45aaef 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-metadata-builder-contributor.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-metadata-builder-contributor.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.metadata-builder-contributor=io.quarkus.hibernate.orm.metadatabuildercontributor.CustomMetadataBuilderContributor \ No newline at end of file diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-metrics-enabled.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-metrics-enabled.properties index b1b6c912d7eec..532fcd3a8fdac 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-metrics-enabled.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-metrics-enabled.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.metrics.enabled=true diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units-annotations.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units-annotations.properties index fb06774c6dbd9..9c096860fe7fc 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units-annotations.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units-annotations.properties @@ -6,13 +6,11 @@ quarkus.datasource.users.jdbc.min-size=2 quarkus.datasource.inventory.db-kind=h2 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create +quarkus.hibernate-orm.datasource= -quarkus.hibernate-orm."users".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."users".database.generation=drop-and-create quarkus.hibernate-orm."users".datasource=users -quarkus.hibernate-orm."inventory".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."inventory".database.generation=drop-and-create quarkus.hibernate-orm."inventory".datasource=inventory diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units-unaffected-entities.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units-unaffected-entities.properties index d0437b3e93556..b47b2ebbbaf59 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units-unaffected-entities.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units-unaffected-entities.properties @@ -1,7 +1,6 @@ quarkus.datasource.inventory.db-kind=h2 quarkus.datasource.inventory.jdbc.url=jdbc:h2:mem:inventory -quarkus.hibernate-orm."inventory".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."inventory".database.generation=drop-and-create quarkus.hibernate-orm."inventory".datasource=inventory quarkus.hibernate-orm."inventory".packages=io.quarkus.hibernate.orm.multiplepersistenceunits.model.config.inventory diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units-undefined-packages.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units-undefined-packages.properties index 5c5133f674e21..78334cec77424 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units-undefined-packages.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units-undefined-packages.properties @@ -1,7 +1,6 @@ quarkus.datasource.users.db-kind=h2 quarkus.datasource.users.jdbc.url=jdbc:h2:tcp://localhost/mem:users -quarkus.hibernate-orm."users".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."users".log.sql=true quarkus.hibernate-orm."users".database.generation=drop-and-create quarkus.hibernate-orm."users".datasource=users diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units.properties index 518855b955874..72629d74f40ed 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-persistence-units.properties @@ -7,16 +7,13 @@ quarkus.datasource.users.jdbc.url=jdbc:h2:mem:users quarkus.datasource.inventory.db-kind=h2 quarkus.datasource.inventory.jdbc.url=jdbc:h2:mem:inventory -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.packages=io.quarkus.hibernate.orm.multiplepersistenceunits.model.config -quarkus.hibernate-orm."users".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."users".database.generation=drop-and-create quarkus.hibernate-orm."users".datasource=users quarkus.hibernate-orm."users".packages=io.quarkus.hibernate.orm.multiplepersistenceunits.model.config.user -quarkus.hibernate-orm."inventory".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."inventory".database.generation=drop-and-create quarkus.hibernate-orm."inventory".datasource=inventory quarkus.hibernate-orm."inventory".packages=io.quarkus.hibernate.orm.multiplepersistenceunits.model.config.inventory diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-pu-discriminator-ignore-explicit-for-joined-default-value.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-pu-discriminator-ignore-explicit-for-joined-default-value.properties index 29d53b5c32584..19e66db9ade8e 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-pu-discriminator-ignore-explicit-for-joined-default-value.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-pu-discriminator-ignore-explicit-for-joined-default-value.properties @@ -4,12 +4,10 @@ quarkus.datasource.users.jdbc.url=jdbc:h2:mem:users quarkus.datasource.inventory.db-kind=h2 quarkus.datasource.inventory.jdbc.url=jdbc:h2:mem:inventory -quarkus.hibernate-orm."users".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."users".database.generation=drop-and-create quarkus.hibernate-orm."users".datasource=users quarkus.hibernate-orm."users".packages=io.quarkus.hibernate.orm.multiplepersistenceunits.model.config.user -quarkus.hibernate-orm."inventory".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."inventory".database.generation=drop-and-create quarkus.hibernate-orm."inventory".datasource=inventory quarkus.hibernate-orm."inventory".packages=io.quarkus.hibernate.orm.multiplepersistenceunits.model.config.inventory \ No newline at end of file diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-pu-discriminator-ignore-explicit-for-joined-true-value.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-pu-discriminator-ignore-explicit-for-joined-true-value.properties index e140185137564..46b278c73084e 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-pu-discriminator-ignore-explicit-for-joined-true-value.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-multiple-pu-discriminator-ignore-explicit-for-joined-true-value.properties @@ -4,13 +4,11 @@ quarkus.datasource.users.jdbc.url=jdbc:h2:mem:users quarkus.datasource.inventory.db-kind=h2 quarkus.datasource.inventory.jdbc.url=jdbc:h2:mem:inventory -quarkus.hibernate-orm."users".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."users".database.generation=drop-and-create quarkus.hibernate-orm."users".datasource=users quarkus.hibernate-orm."users".packages=io.quarkus.hibernate.orm.multiplepersistenceunits.model.config.user quarkus.hibernate-orm."users".discriminator.ignore-explicit-for-joined=true -quarkus.hibernate-orm."inventory".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."inventory".database.generation=drop-and-create quarkus.hibernate-orm."inventory".datasource=inventory quarkus.hibernate-orm."inventory".packages=io.quarkus.hibernate.orm.multiplepersistenceunits.model.config.inventory diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-named-datasource.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-named-datasource.properties index 352e6a0e81f0d..c0ddd620d478b 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-named-datasource.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-named-datasource.properties @@ -1,7 +1,6 @@ quarkus.datasource.users.db-kind=h2 quarkus.datasource.users.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.datasource=users diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-named-pu-explicit-unconfigured-datasource.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-named-pu-explicit-unconfigured-datasource.properties index 863a0b51f6563..4d7291dba7fcb 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-named-pu-explicit-unconfigured-datasource.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-named-pu-explicit-unconfigured-datasource.properties @@ -1,4 +1,3 @@ quarkus.hibernate-orm.pu-1.datasource=ds-1 -quarkus.hibernate-orm.pu-1.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.pu-1.log.sql=true quarkus.hibernate-orm.pu-1.database.generation=drop-and-create diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-named-pu-no-datasource.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-named-pu-no-datasource.properties index e66f6d4872a76..422410bbf6fe1 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-named-pu-no-datasource.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-named-pu-no-datasource.properties @@ -1,3 +1,4 @@ -quarkus.hibernate-orm.pu-1.dialect=org.hibernate.dialect.H2Dialect +# We need at least one build-time property, otherwise the PU gets ignored... +quarkus.hibernate-orm.pu-1.packages=io.quarkus.hibernate.orm.config.namedpu quarkus.hibernate-orm.pu-1.log.sql=true quarkus.hibernate-orm.pu-1.database.generation=drop-and-create diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-no-file-option-test.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-no-file-option-test.properties index 6f03027433ad4..36a18e98ea676 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-no-file-option-test.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-no-file-option-test.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create #quarkus.hibernate-orm.sql-load-script=load-script-test.sql diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-ormxml-annotationoverride-disabled.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-ormxml-annotationoverride-disabled.properties index e8665f3a74cd5..f336f5775929e 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-ormxml-annotationoverride-disabled.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-ormxml-annotationoverride-disabled.properties @@ -1,6 +1,5 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-ormxml-annotationoverride-enabled.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-ormxml-annotationoverride-enabled.properties index e8665f3a74cd5..f336f5775929e 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-ormxml-annotationoverride-enabled.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-ormxml-annotationoverride-enabled.properties @@ -1,6 +1,5 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-other-load-script-test.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-other-load-script-test.properties index 9007dc34a8597..266784b16fee7 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-other-load-script-test.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-other-load-script-test.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.sql-load-script=load-script-test.sql diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-physical-naming-strategy.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-physical-naming-strategy.properties index d338341894e23..4da0245e2c483 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-physical-naming-strategy.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-physical-naming-strategy.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.physical-naming-strategy=io.quarkus.hibernate.orm.naming.PrefixPhysicalNamingStrategy \ No newline at end of file diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application-quoted-identifiers.properties b/extensions/hibernate-orm/deployment/src/test/resources/application-quoted-identifiers.properties index aaf10546730c9..0e3ce6fc6405c 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application-quoted-identifiers.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application-quoted-identifiers.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/extensions/hibernate-orm/deployment/src/test/resources/application.properties b/extensions/hibernate-orm/deployment/src/test/resources/application.properties index e8665f3a74cd5..f336f5775929e 100644 --- a/extensions/hibernate-orm/deployment/src/test/resources/application.properties +++ b/extensions/hibernate-orm/deployment/src/test/resources/application.properties @@ -1,6 +1,5 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/extensions/hibernate-search-orm-coordination-outbox-polling/deployment/src/test/resources/application-multiple-persistence-units.properties b/extensions/hibernate-search-orm-coordination-outbox-polling/deployment/src/test/resources/application-multiple-persistence-units.properties index 7ca4665cc6dc7..9205c99a5af03 100644 --- a/extensions/hibernate-search-orm-coordination-outbox-polling/deployment/src/test/resources/application-multiple-persistence-units.properties +++ b/extensions/hibernate-search-orm-coordination-outbox-polling/deployment/src/test/resources/application-multiple-persistence-units.properties @@ -4,8 +4,8 @@ quarkus.datasource.jdbc.url=jdbc:h2:mem:default;DB_CLOSE_DELAY=-1 quarkus.datasource.data1.db-kind=h2 quarkus.datasource.data1.jdbc.url=jdbc:h2:mem:data1;DB_CLOSE_DELAY=-1 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create +quarkus.hibernate-orm.datasource= quarkus.hibernate-search-orm.elasticsearch.version=7 quarkus.hibernate-search-orm.elasticsearch.hosts=${elasticsearch.hosts:localhost:9200} @@ -13,7 +13,6 @@ quarkus.hibernate-search-orm.elasticsearch.protocol=${elasticsearch.protocol:htt quarkus.hibernate-search-orm.schema-management.strategy=drop-and-create-and-drop quarkus.hibernate-search-orm.coordination.strategy=outbox-polling -quarkus.hibernate-orm."pu1".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."pu1".database.generation=drop-and-create quarkus.hibernate-orm."pu1".datasource=data1 diff --git a/extensions/hibernate-search-orm-coordination-outbox-polling/deployment/src/test/resources/application.properties b/extensions/hibernate-search-orm-coordination-outbox-polling/deployment/src/test/resources/application.properties index ee92e6079b08d..4ebf423c76656 100644 --- a/extensions/hibernate-search-orm-coordination-outbox-polling/deployment/src/test/resources/application.properties +++ b/extensions/hibernate-search-orm-coordination-outbox-polling/deployment/src/test/resources/application.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:default;DB_CLOSE_DELAY=-1 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-search-orm.elasticsearch.version=7 diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-multiple-persistence-units.properties b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-multiple-persistence-units.properties index 7b9b1ea054372..839edb74ed0db 100644 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-multiple-persistence-units.properties +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-multiple-persistence-units.properties @@ -10,7 +10,7 @@ quarkus.datasource.data2.jdbc.url=jdbc:h2:mem:data2;DB_CLOSE_DELAY=-1 quarkus.datasource.data3.db-kind=h2 quarkus.datasource.data3.jdbc.url=jdbc:h2:mem:data3;DB_CLOSE_DELAY=-1 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect +quarkus.hibernate-orm.datasource= quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-search-orm.elasticsearch.version=7 @@ -19,7 +19,6 @@ quarkus.hibernate-search-orm.elasticsearch.protocol=${elasticsearch.protocol:htt quarkus.hibernate-search-orm.schema-management.strategy=drop-and-create-and-drop quarkus.hibernate-search-orm.automatic-indexing.synchronization.strategy=sync -quarkus.hibernate-orm."pu1".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."pu1".database.generation=drop-and-create quarkus.hibernate-orm."pu1".datasource=data1 @@ -29,7 +28,6 @@ quarkus.hibernate-search-orm."pu1".elasticsearch.protocol=${elasticsearch.protoc quarkus.hibernate-search-orm."pu1".schema-management.strategy=drop-and-create-and-drop quarkus.hibernate-search-orm."pu1".automatic-indexing.synchronization.strategy=sync -quarkus.hibernate-orm."pu2".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."pu2".database.generation=drop-and-create quarkus.hibernate-orm."pu2".datasource=data2 @@ -39,7 +37,6 @@ quarkus.hibernate-search-orm."pu2".elasticsearch.protocol=${elasticsearch.protoc quarkus.hibernate-search-orm."pu2".schema-management.strategy=drop-and-create-and-drop quarkus.hibernate-search-orm."pu2".automatic-indexing.synchronization.strategy=sync -quarkus.hibernate-orm."pu3".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."pu3".database.generation=drop-and-create quarkus.hibernate-orm."pu3".datasource=data3 diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-nohsearchconfig.properties b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-nohsearchconfig.properties index 0cb2f82a307a0..0afebcbf20886 100644 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-nohsearchconfig.properties +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-nohsearchconfig.properties @@ -1,5 +1,4 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:default;DB_CLOSE_DELAY=-1 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-start-offline.properties b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-start-offline.properties index 426b14c22c391..88ef2edcc8631 100644 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-start-offline.properties +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-start-offline.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:default;DB_CLOSE_DELAY=-1 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-search-orm.elasticsearch.version=7.10 diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application.properties b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application.properties index 6c481c1983deb..85e7a2fe349ac 100644 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application.properties +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:default;DB_CLOSE_DELAY=-1 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-search-orm.elasticsearch.version=7 diff --git a/extensions/panache/hibernate-orm-panache-kotlin/deployment/src/test/resources/application-erroneous-multiple-persistence-units.properties b/extensions/panache/hibernate-orm-panache-kotlin/deployment/src/test/resources/application-erroneous-multiple-persistence-units.properties index 9c27d55749f9e..99183c318950b 100644 --- a/extensions/panache/hibernate-orm-panache-kotlin/deployment/src/test/resources/application-erroneous-multiple-persistence-units.properties +++ b/extensions/panache/hibernate-orm-panache-kotlin/deployment/src/test/resources/application-erroneous-multiple-persistence-units.properties @@ -4,11 +4,9 @@ quarkus.datasource.jdbc.url=jdbc:h2:mem:default;DB_CLOSE_DELAY=-1 quarkus.datasource.second.db-kind=h2 quarkus.datasource.second.jdbc.url=jdbc:h2:mem:second;DB_CLOSE_DELAY=-1 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.packages=io.quarkus.hibernate.orm.panache.kotlin.deployment.test.multiple_pu.first -quarkus.hibernate-orm."second".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."second".database.generation=drop-and-create quarkus.hibernate-orm."second".datasource=second quarkus.hibernate-orm."second".packages=io.quarkus.hibernate.orm.panache.kotlin.deployment.test.multiple_pu.first diff --git a/extensions/panache/hibernate-orm-panache-kotlin/deployment/src/test/resources/application-multiple-persistence-units.properties b/extensions/panache/hibernate-orm-panache-kotlin/deployment/src/test/resources/application-multiple-persistence-units.properties index f6e8e9c73ad60..3b6a9e6087160 100644 --- a/extensions/panache/hibernate-orm-panache-kotlin/deployment/src/test/resources/application-multiple-persistence-units.properties +++ b/extensions/panache/hibernate-orm-panache-kotlin/deployment/src/test/resources/application-multiple-persistence-units.properties @@ -4,11 +4,9 @@ quarkus.datasource.jdbc.url=jdbc:h2:mem:default;DB_CLOSE_DELAY=-1 quarkus.datasource.second.db-kind=h2 quarkus.datasource.second.jdbc.url=jdbc:h2:mem:second;DB_CLOSE_DELAY=-1 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.packages=io.quarkus.hibernate.orm.panache.kotlin.deployment.test.multiple_pu.first -quarkus.hibernate-orm."second".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."second".database.generation=drop-and-create quarkus.hibernate-orm."second".datasource=second quarkus.hibernate-orm."second".packages=io.quarkus.hibernate.orm.panache.kotlin.deployment.test.multiple_pu.second diff --git a/extensions/panache/hibernate-orm-panache-kotlin/deployment/src/test/resources/application-test.properties b/extensions/panache/hibernate-orm-panache-kotlin/deployment/src/test/resources/application-test.properties index e8665f3a74cd5..f336f5775929e 100644 --- a/extensions/panache/hibernate-orm-panache-kotlin/deployment/src/test/resources/application-test.properties +++ b/extensions/panache/hibernate-orm-panache-kotlin/deployment/src/test/resources/application-test.properties @@ -1,6 +1,5 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-commented-out.properties b/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-commented-out.properties index 17d1a96d7d5a1..654f21320da31 100644 --- a/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-commented-out.properties +++ b/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-commented-out.properties @@ -2,6 +2,5 @@ quarkus.datasource.devservices.enabled=false #quarkus.datasource.jdbc.url=jdbc:h2:mem:test # -#quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true #quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-erroneous-multiple-persistence-units.properties b/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-erroneous-multiple-persistence-units.properties index d6b78c1f0c86d..3623ba3756479 100644 --- a/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-erroneous-multiple-persistence-units.properties +++ b/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-erroneous-multiple-persistence-units.properties @@ -4,11 +4,9 @@ quarkus.datasource.jdbc.url=jdbc:h2:mem:first;DB_CLOSE_DELAY=-1 quarkus.datasource.second.db-kind=h2 quarkus.datasource.second.jdbc.url=jdbc:h2:mem:second;DB_CLOSE_DELAY=-1 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.packages=io.quarkus.hibernate.orm.panache.deployment.test.multiple_pu.first -quarkus.hibernate-orm."second".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."second".database.generation=drop-and-create quarkus.hibernate-orm."second".datasource=second quarkus.hibernate-orm."second".packages=io.quarkus.hibernate.orm.panache.deployment.test.multiple_pu.first diff --git a/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-multiple-persistence-units-for-repository.properties b/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-multiple-persistence-units-for-repository.properties index 7111224eafffe..794dcea7544cd 100644 --- a/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-multiple-persistence-units-for-repository.properties +++ b/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-multiple-persistence-units-for-repository.properties @@ -4,11 +4,9 @@ quarkus.datasource.jdbc.url=jdbc:h2:mem:first;DB_CLOSE_DELAY=-1 quarkus.datasource.repository.db-kind=h2 quarkus.datasource.repository.jdbc.url=jdbc:h2:mem:repository;DB_CLOSE_DELAY=-1 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.packages=io.quarkus.hibernate.orm.panache.deployment.test.multiple_pu.first -quarkus.hibernate-orm."repository".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."repository".database.generation=drop-and-create quarkus.hibernate-orm."repository".datasource=repository quarkus.hibernate-orm."repository".packages=io.quarkus.hibernate.orm.panache.deployment.test.multiple_pu.repository \ No newline at end of file diff --git a/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-multiple-persistence-units.properties b/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-multiple-persistence-units.properties index 2a5bbd813f053..b4c379d7512ef 100644 --- a/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-multiple-persistence-units.properties +++ b/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-multiple-persistence-units.properties @@ -4,11 +4,9 @@ quarkus.datasource.jdbc.url=jdbc:h2:mem:first;DB_CLOSE_DELAY=-1 quarkus.datasource.second.db-kind=h2 quarkus.datasource.second.jdbc.url=jdbc:h2:mem:second;DB_CLOSE_DELAY=-1 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.packages=io.quarkus.hibernate.orm.panache.deployment.test.multiple_pu.first -quarkus.hibernate-orm."second".dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm."second".database.generation=drop-and-create quarkus.hibernate-orm."second".datasource=second quarkus.hibernate-orm."second".packages=io.quarkus.hibernate.orm.panache.deployment.test.multiple_pu.second diff --git a/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-test.properties b/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-test.properties index e8665f3a74cd5..f336f5775929e 100644 --- a/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-test.properties +++ b/extensions/panache/hibernate-orm-panache/deployment/src/test/resources/application-test.properties @@ -1,6 +1,5 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/extensions/panache/hibernate-orm-rest-data-panache/deployment/src/test/resources/application.properties b/extensions/panache/hibernate-orm-rest-data-panache/deployment/src/test/resources/application.properties index bc3d8dca4fd1a..ad9f641ee12e1 100644 --- a/extensions/panache/hibernate-orm-rest-data-panache/deployment/src/test/resources/application.properties +++ b/extensions/panache/hibernate-orm-rest-data-panache/deployment/src/test/resources/application.properties @@ -1,5 +1,4 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/extensions/smallrye-opentracing/deployment/src/test/resources/application.properties b/extensions/smallrye-opentracing/deployment/src/test/resources/application.properties index e9233b769ca72..c474a0d75442b 100644 --- a/extensions/smallrye-opentracing/deployment/src/test/resources/application.properties +++ b/extensions/smallrye-opentracing/deployment/src/test/resources/application.properties @@ -6,7 +6,6 @@ quarkus.datasource.jdbc.max-size=8 quarkus.hibernate-orm.database.generation=drop-and-create #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.sql-load-script=import.sql -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.jaeger.disable-tracer-registration=true diff --git a/extensions/spring-data-jpa/deployment/src/test/resources/application.properties b/extensions/spring-data-jpa/deployment/src/test/resources/application.properties index 3af9a5c790910..0a747dc13f2d7 100644 --- a/extensions/spring-data-jpa/deployment/src/test/resources/application.properties +++ b/extensions/spring-data-jpa/deployment/src/test/resources/application.properties @@ -1,6 +1,5 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect #quarkus.hibernate-orm.log.sql=true quarkus.hibernate-orm.database.generation=drop-and-create \ No newline at end of file diff --git a/extensions/spring-data-rest/deployment/src/test/resources/application.properties b/extensions/spring-data-rest/deployment/src/test/resources/application.properties index bc3d8dca4fd1a..ad9f641ee12e1 100644 --- a/extensions/spring-data-rest/deployment/src/test/resources/application.properties +++ b/extensions/spring-data-rest/deployment/src/test/resources/application.properties @@ -1,5 +1,4 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/integration-tests/cache/src/main/resources/application.properties b/integration-tests/cache/src/main/resources/application.properties index d9d869e504e34..4e01418c2e2ad 100644 --- a/integration-tests/cache/src/main/resources/application.properties +++ b/integration-tests/cache/src/main/resources/application.properties @@ -1,6 +1,5 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.sql-load-script=import.sql diff --git a/integration-tests/gradle/src/main/resources/quarkus-dev-dependency/src/main/resources/application.properties b/integration-tests/gradle/src/main/resources/quarkus-dev-dependency/src/main/resources/application.properties index 0224db32e7226..3057f34dac782 100644 --- a/integration-tests/gradle/src/main/resources/quarkus-dev-dependency/src/main/resources/application.properties +++ b/integration-tests/gradle/src/main/resources/quarkus-dev-dependency/src/main/resources/application.properties @@ -1,6 +1,5 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:test quarkus.datasource.jdbc.driver=org.h2.Driver -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.sql-load-script=import.sql \ No newline at end of file diff --git a/integration-tests/grpc-hibernate/src/main/resources/application.properties b/integration-tests/grpc-hibernate/src/main/resources/application.properties index a78788facf306..508f09e35cd8b 100644 --- a/integration-tests/grpc-hibernate/src/main/resources/application.properties +++ b/integration-tests/grpc-hibernate/src/main/resources/application.properties @@ -1,5 +1,4 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/integration-tests/hibernate-orm-envers/src/main/resources/application.properties b/integration-tests/hibernate-orm-envers/src/main/resources/application.properties index 081c30e274bf8..08e00a8c4439f 100644 --- a/integration-tests/hibernate-orm-envers/src/main/resources/application.properties +++ b/integration-tests/hibernate-orm-envers/src/main/resources/application.properties @@ -2,5 +2,4 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test quarkus.datasource.jdbc.max-size=8 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/integration-tests/hibernate-orm-panache-kotlin/src/main/resources/application.properties b/integration-tests/hibernate-orm-panache-kotlin/src/main/resources/application.properties index 36ee4a18acd81..b524aa27cf943 100644 --- a/integration-tests/hibernate-orm-panache-kotlin/src/main/resources/application.properties +++ b/integration-tests/hibernate-orm-panache-kotlin/src/main/resources/application.properties @@ -2,7 +2,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test quarkus.datasource.jdbc.max-size=8 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.datasource.username=quarkus_test diff --git a/integration-tests/hibernate-orm-panache/src/main/resources/application.properties b/integration-tests/hibernate-orm-panache/src/main/resources/application.properties index 5bb4df40186e1..e085ce3a8e6bc 100644 --- a/integration-tests/hibernate-orm-panache/src/main/resources/application.properties +++ b/integration-tests/hibernate-orm-panache/src/main/resources/application.properties @@ -2,7 +2,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test quarkus.datasource.jdbc.max-size=8 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.statistics=true diff --git a/integration-tests/hibernate-orm-panache/src/main/resources/ddlgeneration.properties b/integration-tests/hibernate-orm-panache/src/main/resources/ddlgeneration.properties index de27a48e388a8..c6c7728a74519 100644 --- a/integration-tests/hibernate-orm-panache/src/main/resources/ddlgeneration.properties +++ b/integration-tests/hibernate-orm-panache/src/main/resources/ddlgeneration.properties @@ -2,7 +2,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test quarkus.datasource.jdbc.max-size=8 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.scripts.generation=drop-and-create diff --git a/integration-tests/hibernate-orm-panache/src/main/resources/nopaging.properties b/integration-tests/hibernate-orm-panache/src/main/resources/nopaging.properties index d15f255c940fa..a831f5baf9791 100644 --- a/integration-tests/hibernate-orm-panache/src/main/resources/nopaging.properties +++ b/integration-tests/hibernate-orm-panache/src/main/resources/nopaging.properties @@ -2,7 +2,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test quarkus.datasource.jdbc.max-size=8 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.log.category."org.hibernate.SQL".level=DEBUG diff --git a/integration-tests/hibernate-search-orm-elasticsearch-coordination-outbox-polling/src/main/resources/application.properties b/integration-tests/hibernate-search-orm-elasticsearch-coordination-outbox-polling/src/main/resources/application.properties index aca4c421f5fe4..56bed6791ed15 100644 --- a/integration-tests/hibernate-search-orm-elasticsearch-coordination-outbox-polling/src/main/resources/application.properties +++ b/integration-tests/hibernate-search-orm-elasticsearch-coordination-outbox-polling/src/main/resources/application.properties @@ -4,7 +4,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test quarkus.datasource.jdbc.max-size=8 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-search-orm.elasticsearch.version=7 diff --git a/integration-tests/hibernate-search-orm-elasticsearch/src/main/resources/application.properties b/integration-tests/hibernate-search-orm-elasticsearch/src/main/resources/application.properties index 3fe775df7bc10..e7fa38a780a80 100644 --- a/integration-tests/hibernate-search-orm-elasticsearch/src/main/resources/application.properties +++ b/integration-tests/hibernate-search-orm-elasticsearch/src/main/resources/application.properties @@ -4,7 +4,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test quarkus.datasource.jdbc.max-size=8 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-search-orm.elasticsearch.version=7 diff --git a/integration-tests/hibernate-search-orm-opensearch/src/main/resources/application.properties b/integration-tests/hibernate-search-orm-opensearch/src/main/resources/application.properties index ad1afe6c3b8df..f5c18a350c7e6 100644 --- a/integration-tests/hibernate-search-orm-opensearch/src/main/resources/application.properties +++ b/integration-tests/hibernate-search-orm-opensearch/src/main/resources/application.properties @@ -4,7 +4,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test quarkus.datasource.jdbc.max-size=8 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-search-orm.elasticsearch.version=opensearch:1.2 diff --git a/integration-tests/jpa-mapping-xml/modern-app/src/main/resources/application.properties b/integration-tests/jpa-mapping-xml/modern-app/src/main/resources/application.properties index 0350e43419992..6bcd1252cd1b7 100644 --- a/integration-tests/jpa-mapping-xml/modern-app/src/main/resources/application.properties +++ b/integration-tests/jpa-mapping-xml/modern-app/src/main/resources/application.properties @@ -9,31 +9,26 @@ quarkus.datasource.libraryA.db-kind=h2 quarkus.datasource.libraryB.db-kind=h2 quarkus.hibernate-orm.xml-mapping-only-dirty-checking.datasource=xml-mapping-only-dirty-checking -quarkus.hibernate-orm.xml-mapping-only-dirty-checking.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.xml-mapping-only-dirty-checking.database.generation=drop-and-create quarkus.hibernate-orm.xml-mapping-only-dirty-checking.packages=io.quarkus.it.jpa.mapping.xml.modern.app.xmlmappingonly.dirtychecking quarkus.hibernate-orm.xml-mapping-only-dirty-checking.mapping-files=xml-mapping-only-dirty-checking.orm.xml quarkus.hibernate-orm.xml-mapping-only-attribute-converter.datasource=xml-mapping-only-attribute-converter -quarkus.hibernate-orm.xml-mapping-only-attribute-converter.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.xml-mapping-only-attribute-converter.database.generation=drop-and-create quarkus.hibernate-orm.xml-mapping-only-attribute-converter.packages=io.quarkus.it.jpa.mapping.xml.modern.app.xmlmappingonly.attributeconverter quarkus.hibernate-orm.xml-mapping-only-attribute-converter.mapping-files=xml-mapping-only-attribute-converter.orm.xml quarkus.hibernate-orm.xml-mapping-only-entity-listener.datasource=xml-mapping-only-entity-listener -quarkus.hibernate-orm.xml-mapping-only-entity-listener.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.xml-mapping-only-entity-listener.database.generation=drop-and-create quarkus.hibernate-orm.xml-mapping-only-entity-listener.packages=io.quarkus.it.jpa.mapping.xml.modern.app.xmlmappingonly.entitylistener quarkus.hibernate-orm.xml-mapping-only-entity-listener.mapping-files=xml-mapping-only-entity-listener.orm.xml quarkus.hibernate-orm.libraryA.datasource=libraryA -quarkus.hibernate-orm.libraryA.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.libraryA.database.generation=drop-and-create quarkus.hibernate-orm.libraryA.packages=io.quarkus.it.jpa.mapping.xml.modern.library_a quarkus.hibernate-orm.libraryA.mapping-files=META-INF/library-a.orm.xml quarkus.hibernate-orm.libraryB.datasource=libraryB -quarkus.hibernate-orm.libraryB.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.libraryB.database.generation=drop-and-create quarkus.hibernate-orm.libraryB.packages=io.quarkus.it.jpa.mapping.xml.modern.library_b quarkus.hibernate-orm.libraryB.mapping-files=META-INF/library-b.orm.xml diff --git a/integration-tests/jpa/src/main/resources/application.properties b/integration-tests/jpa/src/main/resources/application.properties index d388d95390531..a6f3a12630cef 100644 --- a/integration-tests/jpa/src/main/resources/application.properties +++ b/integration-tests/jpa/src/main/resources/application.properties @@ -1,7 +1,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.metadata-builder-contributor=io.quarkus.it.jpa.defaultcatalogandschema.Schema1MetadataBuilderContributor diff --git a/integration-tests/micrometer-prometheus/src/main/resources/application.properties b/integration-tests/micrometer-prometheus/src/main/resources/application.properties index d9468c60ef18a..390ba77e16ca7 100644 --- a/integration-tests/micrometer-prometheus/src/main/resources/application.properties +++ b/integration-tests/micrometer-prometheus/src/main/resources/application.properties @@ -7,7 +7,6 @@ quarkus.log.category."io.quarkus.resteasy.runtime".level=INFO quarkus.log.category."io.netty".level=INFO quarkus.log.category."org.apache".level=INFO -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create quarkus.hibernate-orm.statistics=true quarkus.hibernate-orm.metrics.enabled=true diff --git a/integration-tests/qute/src/main/resources/application.properties b/integration-tests/qute/src/main/resources/application.properties index 723225e17fee8..aad6f9f948224 100644 --- a/integration-tests/qute/src/main/resources/application.properties +++ b/integration-tests/qute/src/main/resources/application.properties @@ -2,5 +2,4 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test quarkus.datasource.jdbc.max-size=8 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create \ No newline at end of file diff --git a/integration-tests/smallrye-context-propagation/src/test/resources/application.properties b/integration-tests/smallrye-context-propagation/src/test/resources/application.properties index 081c30e274bf8..08e00a8c4439f 100644 --- a/integration-tests/smallrye-context-propagation/src/test/resources/application.properties +++ b/integration-tests/smallrye-context-propagation/src/test/resources/application.properties @@ -2,5 +2,4 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test quarkus.datasource.jdbc.max-size=8 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create diff --git a/integration-tests/spring-data-jpa/src/main/resources/application.properties b/integration-tests/spring-data-jpa/src/main/resources/application.properties index 38a00408915ee..57b530c1c638f 100644 --- a/integration-tests/spring-data-jpa/src/main/resources/application.properties +++ b/integration-tests/spring-data-jpa/src/main/resources/application.properties @@ -3,7 +3,6 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test quarkus.datasource.jdbc.max-size=8 -quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create # DataGenerator uses java.util.Random => needs to be runtime initialized # as j.u.Random is prohibited in the native image heap. Otherwise From b0246b48a65971a02dfd4ecf3e781e5c1dd85593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Wed, 20 Jul 2022 10:20:24 +0200 Subject: [PATCH 3/8] Fix a few potential NPEs when Hibernate Search build config is null --- .../HibernateSearchOutboxPollingProcessor.java | 7 ++++++- .../runtime/HibernateSearchElasticsearchRecorder.java | 10 +++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/extensions/hibernate-search-orm-coordination-outbox-polling/deployment/src/main/java/io/quarkus/hibernate/search/orm/coordination/outboxpolling/deployment/HibernateSearchOutboxPollingProcessor.java b/extensions/hibernate-search-orm-coordination-outbox-polling/deployment/src/main/java/io/quarkus/hibernate/search/orm/coordination/outboxpolling/deployment/HibernateSearchOutboxPollingProcessor.java index a2c04bdacbe35..a7bd284e1f49a 100644 --- a/extensions/hibernate-search-orm-coordination-outbox-polling/deployment/src/main/java/io/quarkus/hibernate/search/orm/coordination/outboxpolling/deployment/HibernateSearchOutboxPollingProcessor.java +++ b/extensions/hibernate-search-orm-coordination-outbox-polling/deployment/src/main/java/io/quarkus/hibernate/search/orm/coordination/outboxpolling/deployment/HibernateSearchOutboxPollingProcessor.java @@ -18,6 +18,7 @@ import io.quarkus.hibernate.search.orm.elasticsearch.deployment.HibernateSearchElasticsearchPersistenceUnitConfiguredBuildItem; import io.quarkus.hibernate.search.orm.elasticsearch.deployment.HibernateSearchIntegrationRuntimeConfiguredBuildItem; import io.quarkus.hibernate.search.orm.elasticsearch.deployment.HibernateSearchIntegrationStaticConfiguredBuildItem; +import io.quarkus.hibernate.search.orm.elasticsearch.runtime.HibernateSearchElasticsearchBuildTimeConfigPersistenceUnit; class HibernateSearchOutboxPollingProcessor { @@ -76,7 +77,11 @@ void setRuntimeConfig(HibernateSearchOutboxPollingRecorder recorder, } private boolean isUsingOutboxPolling(HibernateSearchElasticsearchPersistenceUnitConfiguredBuildItem persistenceUnit) { - Optional configuredStrategy = persistenceUnit.getBuildTimeConfig().coordination.strategy; + HibernateSearchElasticsearchBuildTimeConfigPersistenceUnit puConfig = persistenceUnit.getBuildTimeConfig(); + if (puConfig == null) { + return false; + } + Optional configuredStrategy = puConfig.coordination.strategy; return configuredStrategy.isPresent() && configuredStrategy.get().equals(HibernateOrmMapperOutboxPollingSettings.COORDINATION_STRATEGY_NAME); } diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java index 9081f1a45d53a..2fc3210199f49 100644 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java +++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java @@ -163,19 +163,23 @@ private HibernateSearchIntegrationStaticInitListener(String persistenceUnitName, public void contributeBootProperties(BiConsumer propertyCollector) { addConfig(propertyCollector, EngineSettings.BACKGROUND_FAILURE_HANDLER, - HibernateSearchBeanUtil.singleExtensionBeanReferenceFor(buildTimeConfig.backgroundFailureHandler, + HibernateSearchBeanUtil.singleExtensionBeanReferenceFor( + buildTimeConfig == null ? Optional.empty() : buildTimeConfig.backgroundFailureHandler, FailureHandler.class, persistenceUnitName, null, null)); addConfig(propertyCollector, HibernateOrmMapperSettings.COORDINATION_STRATEGY, - HibernateSearchBeanUtil.singleExtensionBeanReferenceFor(buildTimeConfig.coordination.strategy, + HibernateSearchBeanUtil.singleExtensionBeanReferenceFor( + buildTimeConfig == null ? Optional.empty() : buildTimeConfig.coordination.strategy, CoordinationStrategy.class, persistenceUnitName, null, null)); // We need this weird collecting of names from both @SearchExtension and the configuration properties // because a backend/index could potentially be configured exclusively through configuration properties, // or exclusively through @SearchExtension. // (Well maybe not for backends, but... let's keep it simple.) - Map backendConfigs = buildTimeConfig.getAllBackendConfigsAsMap(); + Map backendConfigs = buildTimeConfig == null + ? Collections.emptyMap() + : buildTimeConfig.getAllBackendConfigsAsMap(); Map> backendAndIndexNames = new LinkedHashMap<>(); mergeInto(backendAndIndexNames, backendAndIndexNamesForSearchExtensions); for (Entry entry : backendConfigs.entrySet()) { From 2bd4ac4f107d278acd5dcd9e46af398dfcc556a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Wed, 20 Jul 2022 10:52:13 +0200 Subject: [PATCH 4/8] Always use quotes for the persistence unit name in generated Hibernate Search property keys --- .../runtime/HibernateSearchElasticsearchRuntimeConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java index c85213fe9d2ad..693a2eb0b6839 100644 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java +++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java @@ -52,7 +52,7 @@ public static String mapperPropertyKey(String persistenceUnitName, String radica public static String backendPropertyKey(String persistenceUnitName, String backendName, String indexName, String radical) { StringBuilder keyBuilder = new StringBuilder("quarkus.hibernate-search-orm."); if (!PersistenceUnitUtil.isDefaultPersistenceUnit(persistenceUnitName)) { - keyBuilder.append(persistenceUnitName).append("."); + keyBuilder.append("\"").append(persistenceUnitName).append("\"."); } keyBuilder.append("elasticsearch."); if (backendName != null) { From 9c8f05e1749c73a626ee16ef4553da4df48bf801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Wed, 20 Jul 2022 11:00:15 +0200 Subject: [PATCH 5/8] Consistently consider quoted AND non-quoted versions of quarkus.hibernate-search-orm configuration properties Similar to what we did recently with HibernateOrmProcessor. --- .../HibernateSearchElasticsearchProcessor.java | 7 ++++--- .../HibernateSearchElasticsearchRuntimeConfig.java | 11 +++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java index 849cbfde57bf2..2c5a488b20008 100644 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java @@ -2,6 +2,7 @@ import static io.quarkus.hibernate.search.orm.elasticsearch.deployment.ClassNames.INDEXED; import static io.quarkus.hibernate.search.orm.elasticsearch.runtime.HibernateSearchElasticsearchRuntimeConfig.backendPropertyKey; +import static io.quarkus.hibernate.search.orm.elasticsearch.runtime.HibernateSearchElasticsearchRuntimeConfig.defaultBackendPropertyKeys; import static io.quarkus.hibernate.search.orm.elasticsearch.runtime.HibernateSearchElasticsearchRuntimeConfig.elasticsearchVersionPropertyKey; import static io.quarkus.hibernate.search.orm.elasticsearch.runtime.HibernateSearchElasticsearchRuntimeConfig.mapperPropertyKey; @@ -385,14 +386,14 @@ void devServicesDropAndCreateAndDropByDefault( BuildProducer devServicesAdditionalConfigProducer) { for (HibernateSearchElasticsearchPersistenceUnitConfiguredBuildItem configuredPersistenceUnit : configuredPersistenceUnits) { String puName = configuredPersistenceUnit.getPersistenceUnitName(); - String propertyKeyIndicatingHostsConfigured = backendPropertyKey(puName, null, null, "hosts"); + List propertyKeysIndicatingHostsConfigured = defaultBackendPropertyKeys(puName, "hosts"); - if (!ConfigUtils.isPropertyPresent(propertyKeyIndicatingHostsConfigured)) { + if (!ConfigUtils.isAnyPropertyPresent(propertyKeysIndicatingHostsConfigured)) { String schemaManagementStrategyPropertyKey = mapperPropertyKey(puName, "schema-management.strategy"); if (!ConfigUtils.isPropertyPresent(schemaManagementStrategyPropertyKey)) { String forcedValue = "drop-and-create-and-drop"; devServicesAdditionalConfigProducer - .produce(new DevServicesAdditionalConfigBuildItem(propertyKeyIndicatingHostsConfigured, + .produce(new DevServicesAdditionalConfigBuildItem(propertyKeysIndicatingHostsConfigured, schemaManagementStrategyPropertyKey, forcedValue, () -> LOG.infof("Setting %s=%s to initialize Dev Services managed Elasticsearch server", schemaManagementStrategyPropertyKey, forcedValue))); diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java index 693a2eb0b6839..83f3a9f5c8988 100644 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java +++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java @@ -1,5 +1,6 @@ package io.quarkus.hibernate.search.orm.elasticsearch.runtime; +import java.util.List; import java.util.Map; import java.util.TreeMap; @@ -64,4 +65,14 @@ public static String backendPropertyKey(String persistenceUnitName, String backe keyBuilder.append(radical); return keyBuilder.toString(); } + + public static List defaultBackendPropertyKeys(String persistenceUnitName, String radical) { + if (PersistenceUnitUtil.isDefaultPersistenceUnit(persistenceUnitName)) { + return List.of("quarkus.hibernate-search-orm.elasticsearch." + radical); + } else { + // Two possible syntaxes: with or without quotes + return List.of("quarkus.hibernate-search-orm.\"" + persistenceUnitName + "\".elasticsearch." + radical, + "quarkus.hibernate-search-orm." + persistenceUnitName + ".elasticsearch." + radical); + } + } } From 50452cd108ea4fc2a4ea45917d3ec669c81589c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Wed, 20 Jul 2022 12:56:51 +0200 Subject: [PATCH 6/8] Correctly report missing ".version" in Hibernate Search configuration for named PUs and named backends --- ...rchPersistenceUnitConfiguredBuildItem.java | 11 ++--- ...HibernateSearchElasticsearchProcessor.java | 42 +++++++++---------- .../IndexedEntityInNamedBackend.java | 31 ++++++++++++++ ...gIndexedEntityNamedPuNamedBackendTest.java | 30 +++++++++++++ .../NoConfigIndexedEntityNamedPuTest.java | 30 +++++++++++++ .../NoConfigNoIndexedEntityNamedPuTest.java | 23 ++++++++++ ...cation-nohsearchconfig-named-pu.properties | 6 +++ 7 files changed, 145 insertions(+), 28 deletions(-) create mode 100644 extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/IndexedEntityInNamedBackend.java create mode 100644 extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/NoConfigIndexedEntityNamedPuNamedBackendTest.java create mode 100644 extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/NoConfigIndexedEntityNamedPuTest.java create mode 100644 extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/NoConfigNoIndexedEntityNamedPuTest.java create mode 100644 extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-nohsearchconfig-named-pu.properties diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchPersistenceUnitConfiguredBuildItem.java b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchPersistenceUnitConfiguredBuildItem.java index e30770956081a..715865766f37f 100644 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchPersistenceUnitConfiguredBuildItem.java +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchPersistenceUnitConfiguredBuildItem.java @@ -10,18 +10,19 @@ public final class HibernateSearchElasticsearchPersistenceUnitConfiguredBuildIte private final String persistenceUnitName; private final HibernateSearchElasticsearchBuildTimeConfigPersistenceUnit buildTimeConfig; - private final boolean defaultBackendIsUsed; + private final Set backendNamesForIndexedEntities; private Map> backendAndIndexNamesForSearchExtensions; public HibernateSearchElasticsearchPersistenceUnitConfiguredBuildItem(String persistenceUnitName, - HibernateSearchElasticsearchBuildTimeConfigPersistenceUnit buildTimeConfig, boolean defaultBackendIsUsed, + HibernateSearchElasticsearchBuildTimeConfigPersistenceUnit buildTimeConfig, + Set backendNamesForIndexedEntities, Map> backendAndIndexNamesForSearchExtensions) { if (persistenceUnitName == null) { throw new IllegalArgumentException("persistenceUnitName cannot be null"); } this.persistenceUnitName = persistenceUnitName; this.buildTimeConfig = buildTimeConfig; - this.defaultBackendIsUsed = defaultBackendIsUsed; + this.backendNamesForIndexedEntities = backendNamesForIndexedEntities; this.backendAndIndexNamesForSearchExtensions = backendAndIndexNamesForSearchExtensions; } @@ -33,8 +34,8 @@ public HibernateSearchElasticsearchBuildTimeConfigPersistenceUnit getBuildTimeCo return buildTimeConfig; } - public boolean isDefaultBackendUsed() { - return defaultBackendIsUsed; + public Set getBackendNamesForIndexedEntities() { + return backendNamesForIndexedEntities; } public Map> getBackendAndIndexNamesForSearchExtensions() { diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java index 2c5a488b20008..53cbfdb401b89 100644 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java @@ -26,6 +26,7 @@ import org.hibernate.search.engine.reporting.FailureHandler; import org.hibernate.search.mapper.orm.automaticindexing.session.AutomaticIndexingSynchronizationStrategy; import org.jboss.jandex.AnnotationInstance; +import org.jboss.jandex.AnnotationValue; import org.jboss.jandex.IndexView; import org.jboss.logging.Logger; @@ -163,17 +164,16 @@ private void buildForPersistenceUnit(HibernateSearchElasticsearchRecorder record return; } - boolean defaultBackendIsUsed = false; + Set backendNamesForIndexedEntities = new LinkedHashSet<>(); for (AnnotationInstance indexedAnnotation : indexedAnnotationsForPU) { - if (indexedAnnotation.value("backend") == null) { - defaultBackendIsUsed = true; - break; - } + AnnotationValue backendNameValue = indexedAnnotation.value("backend"); + String backendName = backendNameValue == null ? null : backendNameValue.asString(); + backendNamesForIndexedEntities.add(backendName); } configuredPersistenceUnits .produce(new HibernateSearchElasticsearchPersistenceUnitConfiguredBuildItem(persistenceUnitName, puConfig, - defaultBackendIsUsed, backendAndIndexNamesForSearchExtensions)); + backendNamesForIndexedEntities, backendAndIndexNamesForSearchExtensions)); } @BuildStep @@ -276,25 +276,21 @@ private void processPersistenceUnitBuildTimeConfig( Map backends = buildTimeConfig != null ? buildTimeConfig.getAllBackendConfigsAsMap() : Collections.emptyMap(); - if (configuredPersistenceUnit.isDefaultBackendUsed()) { - ElasticsearchBackendBuildTimeConfig backendConfig = backends.get(null); - // we validate that the default backend is configured and the version is present - if (backendConfig == null || !backendConfig.version.isPresent()) { - propertyKeysWithNoVersion.add(elasticsearchVersionPropertyKey(persistenceUnitName, null)); - } - } - // we validate that the version is present for all backends - for (Entry entry : backends.entrySet()) { - String backendName = entry.getKey(); - ElasticsearchBackendBuildTimeConfig backendConfig = entry.getValue(); - if (!backendConfig.version.isPresent()) { - propertyKeysWithNoVersion - .add(elasticsearchVersionPropertyKey(persistenceUnitName, backendName)); + Set allBackendNames = new LinkedHashSet<>(configuredPersistenceUnit.getBackendNamesForIndexedEntities()); + allBackendNames.addAll(backends.keySet()); + // For all backends referenced either through @Indexed(backend = ...) or configuration... + for (String backendName : allBackendNames) { + ElasticsearchBackendBuildTimeConfig backendConfig = backends.get(backendName); + // ... we validate that the backend is configured and the version is present + if (backendConfig == null || backendConfig.version.isEmpty()) { + propertyKeysWithNoVersion.add(elasticsearchVersionPropertyKey(persistenceUnitName, backendName)); + } + // ... we register files referenced from backends configuration + if (backendConfig != null) { + registerClasspathFileFromBackendConfig(persistenceUnitName, backendName, backendConfig, + applicationArchivesBuildItem, nativeImageResources, hotDeploymentWatchedFiles); } - // we register files referenced from backends configuration - registerClasspathFileFromBackendConfig(persistenceUnitName, backendName, backendConfig, - applicationArchivesBuildItem, nativeImageResources, hotDeploymentWatchedFiles); } if (!propertyKeysWithNoVersion.isEmpty()) { throw new ConfigurationException( diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/IndexedEntityInNamedBackend.java b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/IndexedEntityInNamedBackend.java new file mode 100644 index 0000000000000..be8b1cbc8d060 --- /dev/null +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/IndexedEntityInNamedBackend.java @@ -0,0 +1,31 @@ +package io.quarkus.hibernate.search.orm.elasticsearch.test.configuration; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; + +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; + +/** + * An indexed entity. + */ +@Entity +@Indexed(backend = "mybackend") +public class IndexedEntityInNamedBackend { + + @Id + @GeneratedValue + public Long id; + + @FullTextField + public String name; + + protected IndexedEntityInNamedBackend() { + } + + public IndexedEntityInNamedBackend(String name) { + this.name = name; + } + +} diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/NoConfigIndexedEntityNamedPuNamedBackendTest.java b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/NoConfigIndexedEntityNamedPuNamedBackendTest.java new file mode 100644 index 0000000000000..8ecf2b0ad9e04 --- /dev/null +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/NoConfigIndexedEntityNamedPuNamedBackendTest.java @@ -0,0 +1,30 @@ +package io.quarkus.hibernate.search.orm.elasticsearch.test.configuration; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.sql.SQLException; + +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.runtime.configuration.ConfigurationException; +import io.quarkus.test.QuarkusUnitTest; + +public class NoConfigIndexedEntityNamedPuNamedBackendTest { + + @RegisterExtension + static final QuarkusUnitTest config = new QuarkusUnitTest().setArchiveProducer( + () -> ShrinkWrap.create(JavaArchive.class).addClass(IndexedEntityInNamedBackend.class)) + .withConfigurationResource("application-nohsearchconfig-named-pu.properties") + .assertException(throwable -> assertThat(throwable) + .isInstanceOf(ConfigurationException.class) + .hasMessageContaining("The Elasticsearch version needs to be defined via properties:" + + " quarkus.hibernate-search-orm.\"PU1\".elasticsearch.\"mybackend\".version")); + + @Test + public void testNoConfig() throws SQLException { + // an exception should be thrown + } +} diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/NoConfigIndexedEntityNamedPuTest.java b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/NoConfigIndexedEntityNamedPuTest.java new file mode 100644 index 0000000000000..ede01d37bad80 --- /dev/null +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/NoConfigIndexedEntityNamedPuTest.java @@ -0,0 +1,30 @@ +package io.quarkus.hibernate.search.orm.elasticsearch.test.configuration; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.sql.SQLException; + +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.runtime.configuration.ConfigurationException; +import io.quarkus.test.QuarkusUnitTest; + +public class NoConfigIndexedEntityNamedPuTest { + + @RegisterExtension + static final QuarkusUnitTest config = new QuarkusUnitTest().setArchiveProducer( + () -> ShrinkWrap.create(JavaArchive.class).addClass(IndexedEntity.class)) + .withConfigurationResource("application-nohsearchconfig-named-pu.properties") + .assertException(throwable -> assertThat(throwable) + .isInstanceOf(ConfigurationException.class) + .hasMessageContaining("The Elasticsearch version needs to be defined via properties:" + + " quarkus.hibernate-search-orm.\"PU1\".elasticsearch.version")); + + @Test + public void testNoConfig() throws SQLException { + // an exception should be thrown + } +} diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/NoConfigNoIndexedEntityNamedPuTest.java b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/NoConfigNoIndexedEntityNamedPuTest.java new file mode 100644 index 0000000000000..f31ae0577629f --- /dev/null +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/java/io/quarkus/hibernate/search/orm/elasticsearch/test/configuration/NoConfigNoIndexedEntityNamedPuTest.java @@ -0,0 +1,23 @@ +package io.quarkus.hibernate.search.orm.elasticsearch.test.configuration; + +import java.sql.SQLException; + +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.test.QuarkusUnitTest; + +public class NoConfigNoIndexedEntityNamedPuTest { + + @RegisterExtension + static final QuarkusUnitTest config = new QuarkusUnitTest().setArchiveProducer( + () -> ShrinkWrap.create(JavaArchive.class)) + .withConfigurationResource("application-nohsearchconfig-named-pu.properties"); + + @Test + public void testNoConfig() throws SQLException { + // we should be able to start the application, even with no configuration at all nor indexed entities + } +} diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-nohsearchconfig-named-pu.properties b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-nohsearchconfig-named-pu.properties new file mode 100644 index 0000000000000..253e906d5172b --- /dev/null +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/test/resources/application-nohsearchconfig-named-pu.properties @@ -0,0 +1,6 @@ +quarkus.datasource."data1".db-kind=h2 +quarkus.datasource."data1".jdbc.url=jdbc:h2:mem:default;DB_CLOSE_DELAY=-1 + +quarkus.hibernate-orm."PU1".database.generation=drop-and-create +quarkus.hibernate-orm."PU1".packages=io.quarkus.hibernate.search.orm.elasticsearch.test.configuration +quarkus.hibernate-orm."PU1".datasource=data1 From 060c61d19cc26946a406bc1834e75f00f36c934f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Wed, 20 Jul 2022 14:13:15 +0200 Subject: [PATCH 7/8] Don't ignore AutomaticIndexingSynchronizationStrategy configured through @SearchExtension when there are no runtime configuration properties --- .../HibernateSearchElasticsearchRecorder.java | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java index 2fc3210199f49..b78ebc371b5bc 100644 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java +++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java @@ -281,41 +281,43 @@ private HibernateSearchIntegrationRuntimeInitListener(String persistenceUnitName @Override public void contributeRuntimeProperties(BiConsumer propertyCollector) { - if (runtimeConfig == null) { - return; - } - if (!runtimeConfig.enabled) { - addConfig(propertyCollector, HibernateOrmMapperSettings.ENABLED, false); - // Do not process other properties: Hibernate Search is disabled anyway. - return; + if (runtimeConfig != null) { + if (!runtimeConfig.enabled) { + addConfig(propertyCollector, HibernateOrmMapperSettings.ENABLED, false); + // Do not process other properties: Hibernate Search is disabled anyway. + return; + } + + addConfig(propertyCollector, + HibernateOrmMapperSettings.SCHEMA_MANAGEMENT_STRATEGY, + runtimeConfig.schemaManagement.strategy); + addConfig(propertyCollector, + HibernateOrmMapperSettings.AUTOMATIC_INDEXING_ENABLE_DIRTY_CHECK, + runtimeConfig.automaticIndexing.enableDirtyCheck); + addConfig(propertyCollector, + HibernateOrmMapperSettings.QUERY_LOADING_CACHE_LOOKUP_STRATEGY, + runtimeConfig.queryLoading.cacheLookup.strategy); + addConfig(propertyCollector, + HibernateOrmMapperSettings.QUERY_LOADING_FETCH_SIZE, + runtimeConfig.queryLoading.fetchSize); + addConfig(propertyCollector, + HibernateOrmMapperSettings.MULTI_TENANCY_TENANT_IDS, + runtimeConfig.multiTenancy.tenantIds); } - addConfig(propertyCollector, - HibernateOrmMapperSettings.SCHEMA_MANAGEMENT_STRATEGY, - runtimeConfig.schemaManagement.strategy); addConfig(propertyCollector, HibernateOrmMapperSettings.AUTOMATIC_INDEXING_SYNCHRONIZATION_STRATEGY, HibernateSearchBeanUtil.singleExtensionBeanReferenceFor( - runtimeConfig.automaticIndexing.synchronization.strategy, + runtimeConfig == null ? Optional.empty() : runtimeConfig.automaticIndexing.synchronization.strategy, AutomaticIndexingSynchronizationStrategy.class, persistenceUnitName, null, null)); - addConfig(propertyCollector, - HibernateOrmMapperSettings.AUTOMATIC_INDEXING_ENABLE_DIRTY_CHECK, - runtimeConfig.automaticIndexing.enableDirtyCheck); - addConfig(propertyCollector, - HibernateOrmMapperSettings.QUERY_LOADING_CACHE_LOOKUP_STRATEGY, - runtimeConfig.queryLoading.cacheLookup.strategy); - addConfig(propertyCollector, - HibernateOrmMapperSettings.QUERY_LOADING_FETCH_SIZE, - runtimeConfig.queryLoading.fetchSize); - addConfig(propertyCollector, - HibernateOrmMapperSettings.MULTI_TENANCY_TENANT_IDS, - runtimeConfig.multiTenancy.tenantIds); // We need this weird collecting of names from both @SearchExtension and the configuration properties // because a backend/index could potentially be configured exclusively through configuration properties, // or exclusively through @SearchExtension. // (Well maybe not for backends, but... let's keep it simple.) - Map backendConfigs = runtimeConfig.getAllBackendConfigsAsMap(); + Map backendConfigs = runtimeConfig == null + ? Collections.emptyMap() + : runtimeConfig.getAllBackendConfigsAsMap(); Map> backendAndIndexNames = new LinkedHashMap<>(); mergeInto(backendAndIndexNames, backendAndIndexNamesForSearchExtensions); for (Entry entry : backendConfigs.entrySet()) { From 4b6910730f7061675707823a58c30c47e816c49a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Wed, 20 Jul 2022 14:22:17 +0200 Subject: [PATCH 8/8] Don't even try to resolve @SearchExtension for runtime configuration when Hibernate Search is disabled --- ...HibernateSearchElasticsearchProcessor.java | 2 +- .../HibernateSearchElasticsearchRecorder.java | 27 ++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java index 53cbfdb401b89..d6a830014ca79 100644 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java @@ -160,7 +160,7 @@ private void buildForPersistenceUnit(HibernateSearchElasticsearchRecorder record // we need a runtime listener even when Hibernate Search is disabled, // just to let Hibernate Search boot up until the point where it checks whether it's enabled or not runtimeIntegrations.produce(new HibernateOrmIntegrationRuntimeConfiguredBuildItem(HIBERNATE_SEARCH_ELASTICSEARCH, - persistenceUnitName).setInitListener(recorder.createDisabledRuntimeInitListener(persistenceUnitName))); + persistenceUnitName).setInitListener(recorder.createDisabledRuntimeInitListener())); return; } diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java index b78ebc371b5bc..bf7af08b6e495 100644 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java +++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java @@ -74,9 +74,8 @@ public HibernateOrmIntegrationRuntimeInitListener createRuntimeInitListener( backendAndIndexNamesForSearchExtensions, integrationRuntimeInitListeners); } - public HibernateOrmIntegrationRuntimeInitListener createDisabledRuntimeInitListener(String persistenceUnitName) { - return new HibernateSearchIntegrationRuntimeInitListener(persistenceUnitName, null, Collections.emptyMap(), - Collections.emptyList()); + public HibernateOrmIntegrationRuntimeInitListener createDisabledRuntimeInitListener() { + return new HibernateSearchIntegrationRuntimeInitDisabledListener(); } public Supplier searchMappingSupplier(HibernateSearchElasticsearchRuntimeConfig runtimeConfig, @@ -261,6 +260,28 @@ private void contributeBackendIndexBuildTimeProperties(BiConsumer propertyCollector) { + // Not strictly necessary since this should be set during static init, + // but let's be on the safe side. + propertyCollector.accept(HibernateOrmMapperSettings.ENABLED, false); + } + + @Override + public List> contributeServiceInitiators() { + return List.of( + // The service must be initiated even if Hibernate Search is disabled, + // because it's also responsible for determining that Hibernate Search is disabled. + new HibernateSearchPreIntegrationService.Initiator()); + } + } + private static final class HibernateSearchIntegrationRuntimeInitListener implements HibernateOrmIntegrationRuntimeInitListener {