本文整理匯總了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();
}