initial persistence work for the exception project - to reproduce data exceptions
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
package org.baeldung.ex.dataIntegrityviolationexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.dataIntegrityviolationexception.cause1")
|
||||
public class Cause1DataContextWithJavaConfig {
|
||||
|
||||
public Cause1DataContextWithJavaConfig() {
|
||||
super();
|
||||
}
|
||||
|
||||
// beans
|
||||
|
||||
@Bean
|
||||
public PersistenceExceptionTranslationPostProcessor exceptionTranslation() {
|
||||
return new PersistenceExceptionTranslationPostProcessor();
|
||||
}
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package org.baeldung.ex.dataIntegrityviolationexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.dataIntegrityviolationexception.cause2")
|
||||
public class Cause2DataContextWithJavaConfig {
|
||||
|
||||
public Cause2DataContextWithJavaConfig() {
|
||||
super();
|
||||
}
|
||||
|
||||
// beans
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package org.baeldung.ex.dataIntegrityviolationexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.dataIntegrityviolationexception.cause3")
|
||||
public class Cause3DataContextWithJavaConfig {
|
||||
|
||||
public Cause3DataContextWithJavaConfig() {
|
||||
super();
|
||||
}
|
||||
|
||||
// beans
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user