Java 类org.springframework.orm.jpa.support.OpenEntityManagerInViewInterceptor 实例源码

项目:OperatieBRP    文件:WebConfiguratie.java   
@Override
public void addInterceptors(final InterceptorRegistry registry) {

    for (final EntityManagerFactory entityManagerFactory : entityManagerFactories) {
        final OpenEntityManagerInViewInterceptor openEntityManagerInViewInterceptor = new OpenEntityManagerInViewInterceptor();
        openEntityManagerInViewInterceptor.setEntityManagerFactory(entityManagerFactory);
        registry.addWebRequestInterceptor(openEntityManagerInViewInterceptor);
    }

    super.addInterceptors(registry);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AbstractJpaAutoConfigurationTests.java   
@Test
public void testOpenEntityManagerInViewInterceptorCreated() throws Exception {
    AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
    context.register(TestConfiguration.class, EmbeddedDataSourceConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class, getAutoConfigureClass());
    context.refresh();
    assertThat(context.getBean(OpenEntityManagerInViewInterceptor.class)).isNotNull();
    context.close();
}
项目:spring-boot-concourse    文件:AbstractJpaAutoConfigurationTests.java   
@Test
public void testOpenEntityManagerInViewInterceptorCreated() throws Exception {
    AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
    context.register(TestConfiguration.class, EmbeddedDataSourceConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class, getAutoConfigureClass());
    context.refresh();
    assertThat(context.getBean(OpenEntityManagerInViewInterceptor.class)).isNotNull();
    context.close();
}
项目:contestparser    文件:AbstractJpaAutoConfigurationTests.java   
@Test
public void testOpenEntityManagerInViewInterceptorCreated() throws Exception {
    AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
    context.register(TestConfiguration.class, EmbeddedDataSourceConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class, getAutoConfigureClass());
    context.refresh();
    assertNotNull(context.getBean(OpenEntityManagerInViewInterceptor.class));
    context.close();
}
项目:joinfaces    文件:JpaWebAutoConfigurationTest.java   
@Test(expected = NoSuchBeanDefinitionException.class)
public void testInterceptorDisabled() {
    this.applicationContext.getBean(OpenEntityManagerInViewInterceptor.class);
}
项目:joinfaces    文件:JpaWebAutoConfigurationDisabledTest.java   
@Test(expected = NoSuchBeanDefinitionException.class)
public void testInterceptorDisabled() {
    this.applicationContext.getBean(OpenEntityManagerInViewInterceptor.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JpaBaseConfiguration.java   
@Bean
public OpenEntityManagerInViewInterceptor openEntityManagerInViewInterceptor() {
    return new OpenEntityManagerInViewInterceptor();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AbstractJpaAutoConfigurationTests.java   
private String[] getInterceptorBeans(ApplicationContext context) {
    return context.getBeanNamesForType(OpenEntityManagerInViewInterceptor.class);
}
项目:spring-boot-concourse    文件:JpaBaseConfiguration.java   
@Bean
public OpenEntityManagerInViewInterceptor openEntityManagerInViewInterceptor() {
    return new OpenEntityManagerInViewInterceptor();
}
项目:spring-boot-concourse    文件:AbstractJpaAutoConfigurationTests.java   
private String[] getInterceptorBeans(ApplicationContext context) {
    return context.getBeanNamesForType(OpenEntityManagerInViewInterceptor.class);
}
项目:contestparser    文件:JpaBaseConfiguration.java   
@Bean
public OpenEntityManagerInViewInterceptor openEntityManagerInViewInterceptor() {
    return new OpenEntityManagerInViewInterceptor();
}
项目:contestparser    文件:AbstractJpaAutoConfigurationTests.java   
private String[] getInterceptorBeans(ApplicationContext context) {
    return context.getBeanNamesForType(OpenEntityManagerInViewInterceptor.class);
}
项目:AIDR    文件:ConfigLoader.java   
@Bean
public OpenEntityManagerInViewInterceptor openEntityManagerInViewInterceptor() {
    OpenEntityManagerInViewInterceptor oemiv = new OpenEntityManagerInViewInterceptor();
    oemiv.setEntityManagerFactory(entityManagerFactory);
    return oemiv;
}