本文整理汇总了Java中org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor类的典型用法代码示例。如果您正苦于以下问题:Java PersistenceExceptionTranslationPostProcessor类的具体用法?Java PersistenceExceptionTranslationPostProcessor怎么用?Java PersistenceExceptionTranslationPostProcessor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PersistenceExceptionTranslationPostProcessor类属于org.springframework.dao.annotation包,在下文中一共展示了PersistenceExceptionTranslationPostProcessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: persistenceExceptionTranslationPostProcessor
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(PersistenceExceptionTranslationPostProcessor.class)
@ConditionalOnProperty(prefix = "spring.dao.exceptiontranslation", name = "enabled", matchIfMissing = true)
public static PersistenceExceptionTranslationPostProcessor persistenceExceptionTranslationPostProcessor() {
PersistenceExceptionTranslationPostProcessor postProcessor = new PersistenceExceptionTranslationPostProcessor();
postProcessor.setProxyTargetClass(true);
return postProcessor;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:PersistenceExceptionTranslationAutoConfiguration.java
示例2: exceptionTranslationPostProcessorBeanIsCreated
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
@Test
public void exceptionTranslationPostProcessorBeanIsCreated() {
this.context = new AnnotationConfigApplicationContext(
PersistenceExceptionTranslationAutoConfiguration.class);
Map<String, PersistenceExceptionTranslationPostProcessor> beans = this.context
.getBeansOfType(PersistenceExceptionTranslationPostProcessor.class);
assertThat(beans).hasSize(1);
assertThat(beans.values().iterator().next().isProxyTargetClass()).isTrue();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:PersistenceExceptionTranslationAutoConfigurationTests.java
示例3: exceptionTranslationPostProcessorBeanIsDisabled
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
@Test
public void exceptionTranslationPostProcessorBeanIsDisabled() {
this.context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(this.context,
"spring.dao.exceptiontranslation.enabled=false");
this.context.register(PersistenceExceptionTranslationAutoConfiguration.class);
this.context.refresh();
Map<String, PersistenceExceptionTranslationPostProcessor> beans = this.context
.getBeansOfType(PersistenceExceptionTranslationPostProcessor.class);
assertThat(beans.entrySet()).isEmpty();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:12,代码来源:PersistenceExceptionTranslationAutoConfigurationTests.java
示例4: exceptionTranslation
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
@Bean
public PersistenceExceptionTranslationPostProcessor exceptionTranslation() {
return new PersistenceExceptionTranslationPostProcessor();
}
示例5: exceptionTranslationPostProcessorBeanIsCreated
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
@Test
public void exceptionTranslationPostProcessorBeanIsCreated() {
this.context = new AnnotationConfigApplicationContext(
PersistenceExceptionTranslationAutoConfiguration.class);
Map<String, PersistenceExceptionTranslationPostProcessor> beans = this.context
.getBeansOfType(PersistenceExceptionTranslationPostProcessor.class);
assertThat(beans.size(), is(equalTo(1)));
assertThat(beans.values().iterator().next().isProxyTargetClass(), equalTo(true));
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:10,代码来源:PersistenceExceptionTranslationAutoConfigurationTests.java
示例6: exceptionTranslationPostProcessorBeanIsDisabled
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
@Test
public void exceptionTranslationPostProcessorBeanIsDisabled() {
this.context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(this.context,
"spring.dao.exceptiontranslation.enabled=false");
this.context.register(PersistenceExceptionTranslationAutoConfiguration.class);
this.context.refresh();
Map<String, PersistenceExceptionTranslationPostProcessor> beans = this.context
.getBeansOfType(PersistenceExceptionTranslationPostProcessor.class);
assertThat(beans.entrySet(), empty());
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:12,代码来源:PersistenceExceptionTranslationAutoConfigurationTests.java
示例7: persistenceExceptionTranslationPostProcessor
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
@RefreshScope
@Bean
public PersistenceExceptionTranslationPostProcessor persistenceExceptionTranslationPostProcessor() {
return new PersistenceExceptionTranslationPostProcessor();
}
示例8: persistenceMfaTrustedAuthnExceptionTranslationPostProcessor
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
@RefreshScope
@Bean
public PersistenceExceptionTranslationPostProcessor persistenceMfaTrustedAuthnExceptionTranslationPostProcessor() {
return new PersistenceExceptionTranslationPostProcessor();
}
示例9: exceptionTranslation
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
@Bean
public PersistenceExceptionTranslationPostProcessor exceptionTranslation() {
return new PersistenceExceptionTranslationPostProcessor();
}
示例10: exceptionTranslation
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
@Bean
public PersistenceExceptionTranslationPostProcessor exceptionTranslation(){
return new PersistenceExceptionTranslationPostProcessor();
}
示例11: exceptionTranslation
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
@Bean
public PersistenceExceptionTranslationPostProcessor exceptionTranslation() {
return new PersistenceExceptionTranslationPostProcessor();
}
示例12: persistenceTranslation
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
/**
* Bean that translates SQL exceptions into Spring unified data-access exceptions
* @return Bean
*/
@Bean
public BeanPostProcessor persistenceTranslation(){
return new PersistenceExceptionTranslationPostProcessor();
}
示例13: exceptionTranslation
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
@Bean
public PersistenceExceptionTranslationPostProcessor exceptionTranslation()
{
return new PersistenceExceptionTranslationPostProcessor();
}
示例14: exceptionTranslator
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
@Bean
public PersistenceExceptionTranslationPostProcessor exceptionTranslator() {
return new PersistenceExceptionTranslationPostProcessor();
}
示例15: exceptionTranslation
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; //导入依赖的package包/类
@Bean
public PersistenceExceptionTranslationPostProcessor exceptionTranslation(){
return new PersistenceExceptionTranslationPostProcessor();
}