Skip to content

Commit

Permalink
spring-hibernate project refactorings regarding dependency and spring…
Browse files Browse the repository at this point in the history
… config change
  • Loading branch information
altfatterz committed May 4, 2012
1 parent 77f5077 commit 6f8fea9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
4 changes: 2 additions & 2 deletions spring-hibernate/pom.xml
Expand Up @@ -18,8 +18,8 @@

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.1.1.Final</version>
<artifactId>hibernate-core</artifactId>
<version>4.1.2.Final</version>
<!-- will come with Hibernate core -->
</dependency>

Expand Down
45 changes: 22 additions & 23 deletions spring-hibernate/src/main/resources/app-context.xml
@@ -1,34 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">

<context:component-scan base-package="com.infohubble.learning" />
<jdbc:embedded-database id="dataSource" type="H2" />
<context:component-scan base-package="com.infohubble.learning"/>
<jdbc:embedded-database id="dataSource" type="H2"/>

<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="configLocation" value="classpath:hibernate.cfg.xml" />
<property name="dataSource" ref="dataSource"></property>
<property name="annotatedClasses">
<util:list value-type="java.lang.Class">
<value>com.infohubble.learning.Order</value>
<value>com.infohubble.learning.Item</value>
</util:list>
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="configLocation" value="classpath:hibernate.cfg.xml"/>
<property name="dataSource" ref="dataSource"></property>
<property name="annotatedClasses">
<util:list value-type="java.lang.Class">
<value>com.infohubble.learning.Order</value>
<value>com.infohubble.learning.Item</value>
</util:list>
</property>
</bean>

<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>

<context:component-scan base-package="com.infohubble.learning" />
<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>

</beans>

0 comments on commit 6f8fea9

Please sign in to comment.