diff --git a/spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/config/PersistenceConfig.java b/spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/config/PersistenceConfig.java index f6a0e0d76f..e8f448f4c2 100644 --- a/spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/config/PersistenceConfig.java +++ b/spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/config/PersistenceConfig.java @@ -7,7 +7,6 @@ import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; @@ -18,7 +17,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; import com.google.common.base.Preconditions; -@Configuration +// @Configuration @EnableTransactionManagement @PropertySource({ "classpath:persistence-mysql.properties" }) @ComponentScan({ "org.baeldung.spring.persistence.dao", "org.baeldung.spring.persistence.service" }) diff --git a/spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/config/PersistenceXmlConfig.java b/spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/config/PersistenceXmlConfig.java new file mode 100644 index 0000000000..d8791b6bcc --- /dev/null +++ b/spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/config/PersistenceXmlConfig.java @@ -0,0 +1,18 @@ +package org.baeldung.spring.persistence.config; + +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.ImportResource; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +@Configuration +@EnableTransactionManagement +@ComponentScan({ "org.baeldung.spring.persistence.dao", "org.baeldung.spring.persistence.service" }) +@ImportResource({ "classpath:persistenceConfig.xml" }) +public class PersistenceXmlConfig { + + public PersistenceXmlConfig() { + super(); + } + +} \ No newline at end of file diff --git a/spring-hibernate3-dao/src/main/resources/persistenceConfig.xml b/spring-hibernate3-dao/src/main/resources/persistenceConfig.xml new file mode 100644 index 0000000000..0dc729f815 --- /dev/null +++ b/spring-hibernate3-dao/src/main/resources/persistenceConfig.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + ${hibernate.hbm2ddl.auto} + ${hibernate.dialect} + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-hibernate3-dao/src/main/resources/webSecurityConfig.xml b/spring-hibernate3-dao/src/main/resources/webSecurityConfig.xml deleted file mode 100644 index 5569cc6950..0000000000 --- a/spring-hibernate3-dao/src/main/resources/webSecurityConfig.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file