initial persistence work for the exception project - to reproduce data exceptions

This commit is contained in:
eugenp
2013-08-11 17:14:48 +03:00
parent 6c3a03f929
commit f147b8b0e1
17 changed files with 411 additions and 3 deletions
@@ -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();
}
}
@@ -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
}
@@ -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
}