All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.hibernate.reactive.runtime.ReactivePersistenceProviderSetup Maven / Gradle / Ivy

Go to download

A reactive API for Hibernate ORM, supporting non-blocking database drivers and a reactive style of interaction with the database.

There is a newer version: 3.15.0
Show newest version
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)));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy