io.quarkus.hibernate.reactive.runtime.ReactivePersistenceProviderSetup Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-hibernate-reactive Show documentation
Show all versions of quarkus-hibernate-reactive Show documentation
A reactive API for Hibernate ORM, supporting non-blocking database drivers and a reactive style of interaction with the database.
package io.quarkus.hibernate.reactive.runtime;
import java.util.List;
import java.util.Map;
import io.quarkus.hibernate.orm.runtime.HibernateOrmRuntimeConfig;
import io.quarkus.hibernate.orm.runtime.SingletonPersistenceProviderResolver;
import io.quarkus.hibernate.orm.runtime.integration.HibernateOrmIntegrationRuntimeDescriptor;
public final class ReactivePersistenceProviderSetup {
private ReactivePersistenceProviderSetup() {
// not to be constructed
}
public static void registerStaticInitPersistenceProvider() {
jakarta.persistence.spi.PersistenceProviderResolverHolder
.setPersistenceProviderResolver(new StaticInitHibernateReactivePersistenceProviderResolver());
}
public static void registerRuntimePersistenceProvider(HibernateOrmRuntimeConfig hibernateOrmRuntimeConfig,
Map> integrationRuntimeDescriptors) {
jakarta.persistence.spi.PersistenceProviderResolverHolder
.setPersistenceProviderResolver(
new SingletonPersistenceProviderResolver(
new FastBootHibernateReactivePersistenceProvider(hibernateOrmRuntimeConfig,
integrationRuntimeDescriptors)));
}
}