Skip to content

Commit

Permalink
Merge pull request quarkusio#12451 from Sanne/ORMtoBlockStartupEvents
Browse files Browse the repository at this point in the history
Startup of Hibernate ORM was not registered as a ServiceStartBuildItem
  • Loading branch information
gsmet authored Oct 2, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents e328253 + cce3248 commit 2252b3b
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -95,6 +95,7 @@
import io.quarkus.deployment.builditem.HotDeploymentWatchedFileBuildItem;
import io.quarkus.deployment.builditem.LaunchModeBuildItem;
import io.quarkus.deployment.builditem.LogCategoryBuildItem;
import io.quarkus.deployment.builditem.ServiceStartBuildItem;
import io.quarkus.deployment.builditem.SystemPropertyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
@@ -506,16 +507,17 @@ public void build(HibernateOrmRecorder recorder, HibernateOrmConfig hibernateOrm

@BuildStep
@Record(RUNTIME_INIT)
public void startPersistenceUnits(HibernateOrmRecorder recorder, BeanContainerBuildItem beanContainer,
public ServiceStartBuildItem startPersistenceUnits(HibernateOrmRecorder recorder, BeanContainerBuildItem beanContainer,
List<JdbcDataSourceBuildItem> dataSourcesConfigured,
JpaEntitiesBuildItem jpaEntities, List<NonJpaModelBuildItem> nonJpaModels,
List<HibernateOrmIntegrationRuntimeConfiguredBuildItem> integrationsRuntimeConfigured,
List<JdbcDataSourceSchemaReadyBuildItem> schemaReadyBuildItem) throws Exception {
if (!hasEntities(jpaEntities, nonJpaModels)) {
return;
if (hasEntities(jpaEntities, nonJpaModels)) {
recorder.startAllPersistenceUnits(beanContainer.getValue());
}

recorder.startAllPersistenceUnits(beanContainer.getValue());
return new ServiceStartBuildItem("Hibernate ORM");

}

@BuildStep

0 comments on commit 2252b3b

Please sign in to comment.