From d6f3082b77cd329e5412a62d496d2b96de86d56d Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Mon, 24 Aug 2020 18:47:06 +0100 Subject: [PATCH] Register the QuarkusImportSqlCommandExtractorInitiator consistently in all boot registries --- .../boot/registry/PreconfiguredServiceRegistryBuilder.java | 5 +++-- .../service/StandardHibernateORMInitiatorListProvider.java | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/registry/PreconfiguredServiceRegistryBuilder.java b/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/registry/PreconfiguredServiceRegistryBuilder.java index 8566719f2e4b7..f3f6b60cb6937 100644 --- a/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/registry/PreconfiguredServiceRegistryBuilder.java +++ b/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/registry/PreconfiguredServiceRegistryBuilder.java @@ -38,6 +38,7 @@ import io.quarkus.hibernate.orm.runtime.service.CfgXmlAccessServiceInitiatorQuarkus; import io.quarkus.hibernate.orm.runtime.service.DisabledJMXInitiator; import io.quarkus.hibernate.orm.runtime.service.FlatClassLoaderService; +import io.quarkus.hibernate.orm.runtime.service.QuarkusImportSqlCommandExtractorInitiator; import io.quarkus.hibernate.orm.runtime.service.QuarkusJdbcEnvironmentInitiator; import io.quarkus.hibernate.orm.runtime.service.QuarkusRegionFactoryInitiator; @@ -161,8 +162,8 @@ private static List buildQuarkusServiceInitiatorList(R // TODO (optional): assume entities are already enhanced? serviceInitiators.add(PropertyAccessStrategyResolverInitiator.INSTANCE); - // TODO (optional): not a priority - serviceInitiators.add(ImportSqlCommandExtractorInitiator.INSTANCE); + // Custom one! + serviceInitiators.add(QuarkusImportSqlCommandExtractorInitiator.INSTANCE); // TODO disable? serviceInitiators.add(SchemaManagementToolInitiator.INSTANCE); diff --git a/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/service/StandardHibernateORMInitiatorListProvider.java b/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/service/StandardHibernateORMInitiatorListProvider.java index 5bab19d4ecd90..b531643b738b4 100644 --- a/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/service/StandardHibernateORMInitiatorListProvider.java +++ b/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/service/StandardHibernateORMInitiatorListProvider.java @@ -38,6 +38,11 @@ public final class StandardHibernateORMInitiatorListProvider implements InitialI @Override public List initialInitiatorList() { + + // Note to maintainers: always remember to check for consistency needs with both: + // io.quarkus.hibernate.orm.runtime.boot.registry.PreconfiguredServiceRegistryBuilder#buildQuarkusServiceInitiatorList(RecordedState) + // and ReactiveHibernateInitiatorListProvider + final ArrayList serviceInitiators = new ArrayList(); //This one needs to be replaced after Metadata has been recorded: @@ -47,7 +52,9 @@ public List initialInitiatorList() { serviceInitiators.add(ConfigurationServiceInitiator.INSTANCE); serviceInitiators.add(PropertyAccessStrategyResolverInitiator.INSTANCE); + // Custom one! serviceInitiators.add(QuarkusImportSqlCommandExtractorInitiator.INSTANCE); + serviceInitiators.add(SchemaManagementToolInitiator.INSTANCE); serviceInitiators.add(JdbcEnvironmentInitiator.INSTANCE);