Search in sources :

Example 1 with BeanValidationIntegrator

use of org.hibernate.cfg.beanvalidation.BeanValidationIntegrator in project hibernate-orm by hibernate.

the class BootstrapTest method test_bootstrap_bootstrap_native_registry_BootstrapServiceRegistry_example.

@Test
public void test_bootstrap_bootstrap_native_registry_BootstrapServiceRegistry_example() {
    ClassLoader customClassLoader = Thread.currentThread().getContextClassLoader();
    Integrator customIntegrator = new BeanValidationIntegrator();
    // tag::bootstrap-bootstrap-native-registry-BootstrapServiceRegistry-example[]
    BootstrapServiceRegistryBuilder bootstrapRegistryBuilder = new BootstrapServiceRegistryBuilder();
    // add a custom ClassLoader
    bootstrapRegistryBuilder.applyClassLoader(customClassLoader);
    // manually add an Integrator
    bootstrapRegistryBuilder.applyIntegrator(customIntegrator);
    BootstrapServiceRegistry bootstrapRegistry = bootstrapRegistryBuilder.build();
// end::bootstrap-bootstrap-native-registry-BootstrapServiceRegistry-example[]
}
Also used : BootstrapServiceRegistryBuilder(org.hibernate.boot.registry.BootstrapServiceRegistryBuilder) BeanValidationIntegrator(org.hibernate.cfg.beanvalidation.BeanValidationIntegrator) BeanValidationIntegrator(org.hibernate.cfg.beanvalidation.BeanValidationIntegrator) Integrator(org.hibernate.integrator.spi.Integrator) BootstrapServiceRegistry(org.hibernate.boot.registry.BootstrapServiceRegistry) Test(org.junit.Test)

Aggregations

BootstrapServiceRegistry (org.hibernate.boot.registry.BootstrapServiceRegistry)1 BootstrapServiceRegistryBuilder (org.hibernate.boot.registry.BootstrapServiceRegistryBuilder)1 BeanValidationIntegrator (org.hibernate.cfg.beanvalidation.BeanValidationIntegrator)1 Integrator (org.hibernate.integrator.spi.Integrator)1 Test (org.junit.Test)1