Skip to content

Commit

Permalink
Merge pull request quarkusio#45527 from zakkak/2025-01-10-hibernate-r…
Browse files Browse the repository at this point in the history
…egistrations

Register Parallel Database Query related elements for reflection
  • Loading branch information
gastaldi authored Jan 13, 2025
2 parents 7e76c74 + 2772bac commit 54619a8
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.quarkus.deployment.builditem.nativeimage.JPMSExportBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageAllowIncompleteClasspathBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageConfigBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem;
import io.quarkus.jdbc.db2.runtime.DB2AgroalConnectionConfigurer;
Expand Down Expand Up @@ -66,7 +67,8 @@ void configureAgroalConnection(BuildProducer<AdditionalBeanBuildItem> additional
}

@BuildStep
void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
BuildProducer<NativeImageResourceBuildItem> resource) {
//Not strictly necessary when using Agroal, as it also registers
//any JDBC driver being configured explicitly through its configuration.
//We register it for the sake of people not using Agroal,
Expand All @@ -88,6 +90,12 @@ void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveCla
T4Resources.class)
.reason(getClass().getName() + " DB2 JDBC driver classes")
.build());

reflectiveClass.produce(ReflectiveClassBuildItem.builder("com.ibm.pdq.cmx.client.DataSourceFactory")
.reason(getClass().getName() + " accessed reflectively by DB2 JDBC driver")
.build());

resource.produce(new NativeImageResourceBuildItem("pdq.properties"));
}

@BuildStep
Expand Down

0 comments on commit 54619a8

Please sign in to comment.