Example usage for org.springframework.dao.annotation PersistenceExceptionTranslationPostProcessor setProxyTargetClass

List of usage examples for org.springframework.dao.annotation PersistenceExceptionTranslationPostProcessor setProxyTargetClass

Introduction

In this page you can find the example usage for org.springframework.dao.annotation PersistenceExceptionTranslationPostProcessor setProxyTargetClass.

Prototype

public void setProxyTargetClass(boolean proxyTargetClass) 

Source Link

Document

Set whether to proxy the target class directly, instead of just proxying specific interfaces.

Usage

From source file:demo.DaoConfiguration.java

@Bean
@ConditionalOnMissingBean(PersistenceExceptionTranslationPostProcessor.class)
@ConditionalOnProperty(prefix = "spring.dao.exceptiontranslation", name = "enabled", matchIfMissing = true)
public PersistenceExceptionTranslationPostProcessor persistenceExceptionTranslationPostProcessor() {
    PersistenceExceptionTranslationPostProcessor postProcessor = new PersistenceExceptionTranslationPostProcessor();
    postProcessor.setProxyTargetClass(false); //false is default value but https://github.com/spring-projects/spring-boot/commit/58d660d10d7abb5fe2ea502b6c538714bede62ea
    return postProcessor;
}