[jboss-cvs] jboss-seam/examples/spring/resources ...
Michael Youngstrom
youngm at gmail.com
Wed Jul 11 13:22:52 EDT 2007
User: myoungstrom
Date: 07/07/11 13:22:52
Modified: examples/spring/resources applicationContext.xml
components.xml
Log:
JBSEAM-1346
Revision Changes Path
1.11 +31 -0 jboss-seam/examples/spring/resources/applicationContext.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: applicationContext.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/spring/resources/applicationContext.xml,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- applicationContext.xml 9 Jul 2007 23:10:53 -0000 1.10
+++ applicationContext.xml 11 Jul 2007 17:22:52 -0000 1.11
@@ -17,6 +17,7 @@
<property name="username" value="sa"/>
<property name="password" value=""/>
</bean>
+
<!-- Here we are using a spring configured EMF you can just as easily use a Seam configured EMF using
<persistence:entity-manager-factory/> unless your project depends upon some functionality spring
provides an EMF such as the ability to inject a dataSource.
@@ -69,4 +70,34 @@
<!-- TaskExecutor for example use of @Asynchronous -->
<bean id="springThreadPoolTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor" />
+
+ <!-- Sample Hibernate Configuration -->
+
+ <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
+ <property name="dataSource" ref="dataSource"/>
+ <property name="annotatedClasses">
+ <list>
+ <value>org.jboss.seam.example.spring.Hotel</value>
+ <value>org.jboss.seam.example.spring.User</value>
+ <value>org.jboss.seam.example.spring.Booking</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="seamSessionFactory" class="org.jboss.seam.ioc.spring.SeamManagedSessionFactoryBean">
+ <property name="sessionName" value="hibernateSession"/>
+ </bean>
+
+ <bean id="hibernateTestService" class="org.jboss.seam.example.spring.HibernateTestService">
+ <property name="sessionFactory" ref="seamSessionFactory"/>
+ <property name="transactionTemplate" ref="hibernateTransactionTemplate"/>
+ </bean>
+
+ <bean id="hibernateTransactionTemplate" class="org.springframework.transaction.support.TransactionTemplate">
+ <property name="transactionManager" ref="hibernateTransactionManager"/>
+ </bean>
+
+ <bean id="hibernateTransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
+ <property name="sessionFactory" ref="seamSessionFactory"/>
+ </bean>
</beans>
1.3 +3 -0 jboss-seam/examples/spring/resources/components.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: components.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/spring/resources/components.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- components.xml 9 Jul 2007 23:10:53 -0000 1.2
+++ components.xml 11 Jul 2007 17:22:52 -0000 1.3
@@ -18,6 +18,9 @@
auto-create="true"
entity-manager-factory="#{entityManagerFactory}" />
+ <!-- Sample Hibernate Session -->
+ <persistence:managed-hibernate-session name="hibernateSession" auto-create="true" session-factory="#{sessionFactory}"/>
+
<core:init debug="true"/>
<spring:context-loader />
More information about the jboss-cvs-commits
mailing list