diff --git a/spring-hibernate3-dao/.classpath b/spring-hibernate3/.classpath similarity index 100% rename from spring-hibernate3-dao/.classpath rename to spring-hibernate3/.classpath diff --git a/spring-hibernate3-dao/.gitignore b/spring-hibernate3/.gitignore similarity index 100% rename from spring-hibernate3-dao/.gitignore rename to spring-hibernate3/.gitignore diff --git a/spring-hibernate3-dao/.project b/spring-hibernate3/.project similarity index 100% rename from spring-hibernate3-dao/.project rename to spring-hibernate3/.project diff --git a/spring-hibernate3-dao/.settings/.jsdtscope b/spring-hibernate3/.settings/.jsdtscope similarity index 100% rename from spring-hibernate3-dao/.settings/.jsdtscope rename to spring-hibernate3/.settings/.jsdtscope diff --git a/spring-hibernate3-dao/.settings/org.eclipse.jdt.core.prefs b/spring-hibernate3/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from spring-hibernate3-dao/.settings/org.eclipse.jdt.core.prefs rename to spring-hibernate3/.settings/org.eclipse.jdt.core.prefs diff --git a/spring-hibernate3-dao/.settings/org.eclipse.jdt.ui.prefs b/spring-hibernate3/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from spring-hibernate3-dao/.settings/org.eclipse.jdt.ui.prefs rename to spring-hibernate3/.settings/org.eclipse.jdt.ui.prefs diff --git a/spring-hibernate3-dao/.settings/org.eclipse.m2e.core.prefs b/spring-hibernate3/.settings/org.eclipse.m2e.core.prefs similarity index 100% rename from spring-hibernate3-dao/.settings/org.eclipse.m2e.core.prefs rename to spring-hibernate3/.settings/org.eclipse.m2e.core.prefs diff --git a/spring-hibernate3-dao/.settings/org.eclipse.m2e.wtp.prefs b/spring-hibernate3/.settings/org.eclipse.m2e.wtp.prefs similarity index 100% rename from spring-hibernate3-dao/.settings/org.eclipse.m2e.wtp.prefs rename to spring-hibernate3/.settings/org.eclipse.m2e.wtp.prefs diff --git a/spring-hibernate3-dao/.settings/org.eclipse.wst.common.component b/spring-hibernate3/.settings/org.eclipse.wst.common.component similarity index 100% rename from spring-hibernate3-dao/.settings/org.eclipse.wst.common.component rename to spring-hibernate3/.settings/org.eclipse.wst.common.component diff --git a/spring-hibernate3-dao/.settings/org.eclipse.wst.common.project.facet.core.xml b/spring-hibernate3/.settings/org.eclipse.wst.common.project.facet.core.xml similarity index 100% rename from spring-hibernate3-dao/.settings/org.eclipse.wst.common.project.facet.core.xml rename to spring-hibernate3/.settings/org.eclipse.wst.common.project.facet.core.xml diff --git a/spring-hibernate3-dao/.settings/org.eclipse.wst.jsdt.ui.superType.container b/spring-hibernate3/.settings/org.eclipse.wst.jsdt.ui.superType.container similarity index 100% rename from spring-hibernate3-dao/.settings/org.eclipse.wst.jsdt.ui.superType.container rename to spring-hibernate3/.settings/org.eclipse.wst.jsdt.ui.superType.container diff --git a/spring-hibernate3-dao/.settings/org.eclipse.wst.jsdt.ui.superType.name b/spring-hibernate3/.settings/org.eclipse.wst.jsdt.ui.superType.name similarity index 100% rename from spring-hibernate3-dao/.settings/org.eclipse.wst.jsdt.ui.superType.name rename to spring-hibernate3/.settings/org.eclipse.wst.jsdt.ui.superType.name diff --git a/spring-hibernate3-dao/.settings/org.eclipse.wst.validation.prefs b/spring-hibernate3/.settings/org.eclipse.wst.validation.prefs similarity index 100% rename from spring-hibernate3-dao/.settings/org.eclipse.wst.validation.prefs rename to spring-hibernate3/.settings/org.eclipse.wst.validation.prefs diff --git a/spring-hibernate3-dao/.settings/org.eclipse.wst.ws.service.policy.prefs b/spring-hibernate3/.settings/org.eclipse.wst.ws.service.policy.prefs similarity index 100% rename from spring-hibernate3-dao/.settings/org.eclipse.wst.ws.service.policy.prefs rename to spring-hibernate3/.settings/org.eclipse.wst.ws.service.policy.prefs diff --git a/spring-hibernate3-dao/.springBeans b/spring-hibernate3/.springBeans similarity index 100% rename from spring-hibernate3-dao/.springBeans rename to spring-hibernate3/.springBeans diff --git a/spring-hibernate3-dao/README.md b/spring-hibernate3/README.md similarity index 100% rename from spring-hibernate3-dao/README.md rename to spring-hibernate3/README.md diff --git a/spring-hibernate3-dao/pom.xml b/spring-hibernate3/pom.xml similarity index 100% rename from spring-hibernate3-dao/pom.xml rename to spring-hibernate3/pom.xml diff --git a/spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/config/PersistenceConfig.java b/spring-hibernate3/src/main/java/org/baeldung/spring/persistence/config/PersistenceConfig.java similarity index 100% rename from spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/config/PersistenceConfig.java rename to spring-hibernate3/src/main/java/org/baeldung/spring/persistence/config/PersistenceConfig.java diff --git a/spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/config/PersistenceXmlConfig.java b/spring-hibernate3/src/main/java/org/baeldung/spring/persistence/config/PersistenceXmlConfig.java similarity index 100% rename from spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/config/PersistenceXmlConfig.java rename to spring-hibernate3/src/main/java/org/baeldung/spring/persistence/config/PersistenceXmlConfig.java diff --git a/spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/dao/FooDao.java b/spring-hibernate3/src/main/java/org/baeldung/spring/persistence/dao/FooDao.java similarity index 100% rename from spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/dao/FooDao.java rename to spring-hibernate3/src/main/java/org/baeldung/spring/persistence/dao/FooDao.java diff --git a/spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/dao/IFooDao.java b/spring-hibernate3/src/main/java/org/baeldung/spring/persistence/dao/IFooDao.java similarity index 100% rename from spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/dao/IFooDao.java rename to spring-hibernate3/src/main/java/org/baeldung/spring/persistence/dao/IFooDao.java diff --git a/spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/model/Foo.java b/spring-hibernate3/src/main/java/org/baeldung/spring/persistence/model/Foo.java similarity index 100% rename from spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/model/Foo.java rename to spring-hibernate3/src/main/java/org/baeldung/spring/persistence/model/Foo.java diff --git a/spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/service/FooService.java b/spring-hibernate3/src/main/java/org/baeldung/spring/persistence/service/FooService.java similarity index 100% rename from spring-hibernate3-dao/src/main/java/org/baeldung/spring/persistence/service/FooService.java rename to spring-hibernate3/src/main/java/org/baeldung/spring/persistence/service/FooService.java diff --git a/spring-hibernate3-dao/src/main/resources/logback.xml b/spring-hibernate3/src/main/resources/logback.xml similarity index 100% rename from spring-hibernate3-dao/src/main/resources/logback.xml rename to spring-hibernate3/src/main/resources/logback.xml diff --git a/spring-hibernate3-dao/src/main/resources/persistence-mysql.properties b/spring-hibernate3/src/main/resources/persistence-mysql.properties similarity index 100% rename from spring-hibernate3-dao/src/main/resources/persistence-mysql.properties rename to spring-hibernate3/src/main/resources/persistence-mysql.properties diff --git a/spring-hibernate3-dao/src/main/resources/persistenceConfig.xml b/spring-hibernate3/src/main/resources/persistenceConfig.xml similarity index 100% rename from spring-hibernate3-dao/src/main/resources/persistenceConfig.xml rename to spring-hibernate3/src/main/resources/persistenceConfig.xml diff --git a/spring-hibernate3-dao/src/main/webapp/WEB-INF/mvc-servlet.xml b/spring-hibernate3/src/main/webapp/WEB-INF/mvc-servlet.xml similarity index 100% rename from spring-hibernate3-dao/src/main/webapp/WEB-INF/mvc-servlet.xml rename to spring-hibernate3/src/main/webapp/WEB-INF/mvc-servlet.xml diff --git a/spring-hibernate3-dao/src/main/webapp/WEB-INF/view/sample.jsp b/spring-hibernate3/src/main/webapp/WEB-INF/view/sample.jsp similarity index 100% rename from spring-hibernate3-dao/src/main/webapp/WEB-INF/view/sample.jsp rename to spring-hibernate3/src/main/webapp/WEB-INF/view/sample.jsp diff --git a/spring-hibernate3-dao/src/main/webapp/WEB-INF/web.xml b/spring-hibernate3/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-hibernate3-dao/src/main/webapp/WEB-INF/web.xml rename to spring-hibernate3/src/main/webapp/WEB-INF/web.xml diff --git a/spring-hibernate3-dao/src/test/resources/.gitignore b/spring-hibernate3/src/test/resources/.gitignore similarity index 100% rename from spring-hibernate3-dao/src/test/resources/.gitignore rename to spring-hibernate3/src/test/resources/.gitignore diff --git a/spring-hibernate4-dao/.classpath b/spring-hibernate4/.classpath similarity index 100% rename from spring-hibernate4-dao/.classpath rename to spring-hibernate4/.classpath diff --git a/spring-hibernate4-dao/.gitignore b/spring-hibernate4/.gitignore similarity index 100% rename from spring-hibernate4-dao/.gitignore rename to spring-hibernate4/.gitignore diff --git a/spring-hibernate4-dao/.project b/spring-hibernate4/.project similarity index 98% rename from spring-hibernate4-dao/.project rename to spring-hibernate4/.project index 3207889770..233d73c017 100644 --- a/spring-hibernate4-dao/.project +++ b/spring-hibernate4/.project @@ -1,6 +1,6 @@ - spring-hibernate4-dao + spring-hibernate4 diff --git a/spring-hibernate4-dao/.settings/.jsdtscope b/spring-hibernate4/.settings/.jsdtscope similarity index 100% rename from spring-hibernate4-dao/.settings/.jsdtscope rename to spring-hibernate4/.settings/.jsdtscope diff --git a/spring-hibernate4-dao/.settings/org.eclipse.jdt.core.prefs b/spring-hibernate4/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from spring-hibernate4-dao/.settings/org.eclipse.jdt.core.prefs rename to spring-hibernate4/.settings/org.eclipse.jdt.core.prefs diff --git a/spring-hibernate4-dao/.settings/org.eclipse.jdt.ui.prefs b/spring-hibernate4/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from spring-hibernate4-dao/.settings/org.eclipse.jdt.ui.prefs rename to spring-hibernate4/.settings/org.eclipse.jdt.ui.prefs diff --git a/spring-hibernate4-dao/.settings/org.eclipse.m2e.core.prefs b/spring-hibernate4/.settings/org.eclipse.m2e.core.prefs similarity index 100% rename from spring-hibernate4-dao/.settings/org.eclipse.m2e.core.prefs rename to spring-hibernate4/.settings/org.eclipse.m2e.core.prefs diff --git a/spring-hibernate4-dao/.settings/org.eclipse.m2e.wtp.prefs b/spring-hibernate4/.settings/org.eclipse.m2e.wtp.prefs similarity index 100% rename from spring-hibernate4-dao/.settings/org.eclipse.m2e.wtp.prefs rename to spring-hibernate4/.settings/org.eclipse.m2e.wtp.prefs diff --git a/spring-hibernate4-dao/.settings/org.eclipse.wst.common.component b/spring-hibernate4/.settings/org.eclipse.wst.common.component similarity index 78% rename from spring-hibernate4-dao/.settings/org.eclipse.wst.common.component rename to spring-hibernate4/.settings/org.eclipse.wst.common.component index 2746e4b443..6192602079 100644 --- a/spring-hibernate4-dao/.settings/org.eclipse.wst.common.component +++ b/spring-hibernate4/.settings/org.eclipse.wst.common.component @@ -1,10 +1,10 @@ - + - - + + diff --git a/spring-hibernate4-dao/.settings/org.eclipse.wst.common.project.facet.core.xml b/spring-hibernate4/.settings/org.eclipse.wst.common.project.facet.core.xml similarity index 100% rename from spring-hibernate4-dao/.settings/org.eclipse.wst.common.project.facet.core.xml rename to spring-hibernate4/.settings/org.eclipse.wst.common.project.facet.core.xml diff --git a/spring-hibernate4-dao/.settings/org.eclipse.wst.jsdt.ui.superType.container b/spring-hibernate4/.settings/org.eclipse.wst.jsdt.ui.superType.container similarity index 100% rename from spring-hibernate4-dao/.settings/org.eclipse.wst.jsdt.ui.superType.container rename to spring-hibernate4/.settings/org.eclipse.wst.jsdt.ui.superType.container diff --git a/spring-hibernate4-dao/.settings/org.eclipse.wst.jsdt.ui.superType.name b/spring-hibernate4/.settings/org.eclipse.wst.jsdt.ui.superType.name similarity index 100% rename from spring-hibernate4-dao/.settings/org.eclipse.wst.jsdt.ui.superType.name rename to spring-hibernate4/.settings/org.eclipse.wst.jsdt.ui.superType.name diff --git a/spring-hibernate4-dao/.settings/org.eclipse.wst.validation.prefs b/spring-hibernate4/.settings/org.eclipse.wst.validation.prefs similarity index 100% rename from spring-hibernate4-dao/.settings/org.eclipse.wst.validation.prefs rename to spring-hibernate4/.settings/org.eclipse.wst.validation.prefs diff --git a/spring-hibernate4-dao/.settings/org.eclipse.wst.ws.service.policy.prefs b/spring-hibernate4/.settings/org.eclipse.wst.ws.service.policy.prefs similarity index 100% rename from spring-hibernate4-dao/.settings/org.eclipse.wst.ws.service.policy.prefs rename to spring-hibernate4/.settings/org.eclipse.wst.ws.service.policy.prefs diff --git a/spring-hibernate4-dao/.springBeans b/spring-hibernate4/.springBeans similarity index 100% rename from spring-hibernate4-dao/.springBeans rename to spring-hibernate4/.springBeans diff --git a/spring-hibernate4-dao/README.md b/spring-hibernate4/README.md similarity index 100% rename from spring-hibernate4-dao/README.md rename to spring-hibernate4/README.md diff --git a/spring-hibernate4-dao/pom.xml b/spring-hibernate4/pom.xml similarity index 97% rename from spring-hibernate4-dao/pom.xml rename to spring-hibernate4/pom.xml index 940289493d..c7171e0acd 100644 --- a/spring-hibernate4-dao/pom.xml +++ b/spring-hibernate4/pom.xml @@ -1,10 +1,10 @@ 4.0.0 org.baeldung - spring-hibernate4-dao + spring-hibernate4 0.1-SNAPSHOT - spring-hibernate4-dao + spring-hibernate4 war @@ -86,7 +86,7 @@ - spring-hibernate4-dao + spring-hibernate4 src/main/resources diff --git a/spring-hibernate4/src/main/java/org/baeldung/spring/persistence/config/HibernateXmlConfig.java b/spring-hibernate4/src/main/java/org/baeldung/spring/persistence/config/HibernateXmlConfig.java new file mode 100644 index 0000000000..51fbcd27c1 --- /dev/null +++ b/spring-hibernate4/src/main/java/org/baeldung/spring/persistence/config/HibernateXmlConfig.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:hibernate4Config.xml" }) +public class HibernateXmlConfig { + + public HibernateXmlConfig() { + super(); + } + +} \ No newline at end of file diff --git a/spring-hibernate4-dao/src/main/java/org/baeldung/spring/persistence/config/PersistenceConfig.java b/spring-hibernate4/src/main/java/org/baeldung/spring/persistence/config/PersistenceConfig.java similarity index 100% rename from spring-hibernate4-dao/src/main/java/org/baeldung/spring/persistence/config/PersistenceConfig.java rename to spring-hibernate4/src/main/java/org/baeldung/spring/persistence/config/PersistenceConfig.java diff --git a/spring-hibernate4-dao/src/main/java/org/baeldung/spring/persistence/dao/FooDao.java b/spring-hibernate4/src/main/java/org/baeldung/spring/persistence/dao/FooDao.java similarity index 100% rename from spring-hibernate4-dao/src/main/java/org/baeldung/spring/persistence/dao/FooDao.java rename to spring-hibernate4/src/main/java/org/baeldung/spring/persistence/dao/FooDao.java diff --git a/spring-hibernate4-dao/src/main/java/org/baeldung/spring/persistence/dao/IFooDao.java b/spring-hibernate4/src/main/java/org/baeldung/spring/persistence/dao/IFooDao.java similarity index 100% rename from spring-hibernate4-dao/src/main/java/org/baeldung/spring/persistence/dao/IFooDao.java rename to spring-hibernate4/src/main/java/org/baeldung/spring/persistence/dao/IFooDao.java diff --git a/spring-hibernate4-dao/src/main/java/org/baeldung/spring/persistence/model/Foo.java b/spring-hibernate4/src/main/java/org/baeldung/spring/persistence/model/Foo.java similarity index 100% rename from spring-hibernate4-dao/src/main/java/org/baeldung/spring/persistence/model/Foo.java rename to spring-hibernate4/src/main/java/org/baeldung/spring/persistence/model/Foo.java diff --git a/spring-hibernate4-dao/src/main/java/org/baeldung/spring/persistence/service/FooService.java b/spring-hibernate4/src/main/java/org/baeldung/spring/persistence/service/FooService.java similarity index 100% rename from spring-hibernate4-dao/src/main/java/org/baeldung/spring/persistence/service/FooService.java rename to spring-hibernate4/src/main/java/org/baeldung/spring/persistence/service/FooService.java diff --git a/spring-hibernate4/src/main/resources/hibernate4Config.xml b/spring-hibernate4/src/main/resources/hibernate4Config.xml new file mode 100644 index 0000000000..f35de2a4c5 --- /dev/null +++ b/spring-hibernate4/src/main/resources/hibernate4Config.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + ${hibernate.hbm2ddl.auto} + ${hibernate.dialect} + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-hibernate4-dao/src/main/resources/logback.xml b/spring-hibernate4/src/main/resources/logback.xml similarity index 100% rename from spring-hibernate4-dao/src/main/resources/logback.xml rename to spring-hibernate4/src/main/resources/logback.xml diff --git a/spring-hibernate4-dao/src/main/resources/persistence-mysql.properties b/spring-hibernate4/src/main/resources/persistence-mysql.properties similarity index 100% rename from spring-hibernate4-dao/src/main/resources/persistence-mysql.properties rename to spring-hibernate4/src/main/resources/persistence-mysql.properties diff --git a/spring-hibernate4-dao/src/main/resources/webSecurityConfig.xml b/spring-hibernate4/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-hibernate4-dao/src/main/resources/webSecurityConfig.xml rename to spring-hibernate4/src/main/resources/webSecurityConfig.xml diff --git a/spring-hibernate4-dao/src/main/webapp/WEB-INF/mvc-servlet.xml b/spring-hibernate4/src/main/webapp/WEB-INF/mvc-servlet.xml similarity index 100% rename from spring-hibernate4-dao/src/main/webapp/WEB-INF/mvc-servlet.xml rename to spring-hibernate4/src/main/webapp/WEB-INF/mvc-servlet.xml diff --git a/spring-hibernate4-dao/src/main/webapp/WEB-INF/view/sample.jsp b/spring-hibernate4/src/main/webapp/WEB-INF/view/sample.jsp similarity index 100% rename from spring-hibernate4-dao/src/main/webapp/WEB-INF/view/sample.jsp rename to spring-hibernate4/src/main/webapp/WEB-INF/view/sample.jsp diff --git a/spring-hibernate4-dao/src/main/webapp/WEB-INF/web.xml b/spring-hibernate4/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-hibernate4-dao/src/main/webapp/WEB-INF/web.xml rename to spring-hibernate4/src/main/webapp/WEB-INF/web.xml diff --git a/spring-hibernate4-dao/src/test/resources/.gitignore b/spring-hibernate4/src/test/resources/.gitignore similarity index 100% rename from spring-hibernate4-dao/src/test/resources/.gitignore rename to spring-hibernate4/src/test/resources/.gitignore