cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: Questions on CHS (Cocoon, Hibernate, Spring) petstore project
Date Mon, 11 Apr 2005 08:59:27 GMT
Jonny Pony wrote:
> Hi,
> 
> I've got a couple of questions on the CHS(Cocoon, Hibernate, Spring) 
> petstore project:
my config is:

> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
> <beans>
> 	<!-- 'system' beans -->
> 	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
> 		<property name="driverClassName">
> 			<value>${db.driver}</value>
> 		</property>
> 		<property name="url">
> 			<value>${db.url}</value>
> 		</property>
> 		<property name="username">
> 			<value>${db.username}</value>
> 		</property>
> 		<property name="password">
> 			<value>${db.password}</value>
> 		</property>
> 	</bean>
> 	<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
> 		<property name="configLocation">
> 			<value>classpath:hibernate.cfg.xml</value>
> 		</property>
> 		<property name="hibernateProperties">
> 			<props>
> 				<prop key="hibernate.dialect">${hibernate.dialect}</prop>
> 				<prop key="hibernate.show_sql">${hibernate.showsql}</prop>
> 			</props>
> 		</property>
> 		<property name="dataSource">
> 			<ref bean="dataSource"/>
> 		</property>
> 	</bean>
> 	<bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
> 		<property name="sessionFactory">
> 			<ref bean="sessionFactory"/>
> 		</property>
> 	</bean>
> 	<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
> 		<property name="location"><value>classpath:/spring.properties</value></property>
> 	</bean>
> 	<bean id="matchAllWithPropReq" class="org.springframework.transaction.interceptor.MatchAlwaysTransactionAttributeSource">
> 		<property name="transactionAttribute"><value>PROPAGATION_REQUIRED</value></property>
> 	</bean>
> 	<bean id="matchAllTxInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
> 		<property name="transactionManager"><ref bean="transactionManager"/></property>
> 		<property name="transactionAttributeSource"><ref bean="matchAllWithPropReq"/></property>
> 	</bean>
> 	<bean id="autoProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
> 		<property name="interceptorNames">
> 			<list>
> 				<idref local="matchAllTxInterceptor"/>
> 			</list>
> 		</property>
> 		<property name="beanNames">
> 			<list>
> 				<value>*Service</value>
> 			</list>
> 		</property>
> 	</bean>        
> 	<!-- 'application beans' -->
> </beans>

and the hibernate.cfg.xml is:
> <!DOCTYPE hibernate-configuration PUBLIC 
> 	"-//Hibernate/Hibernate Configuration DTD//EN"
> 	"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
> <hibernate-configuration>
> 	<session-factory>
> 		<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
> 		<property name="jdbc.use_streams_for_binary">true</property>
> 		<property name="max_fetch_depth">2</property>
> 		<property name="cache.provider_class">net.sf.hibernate.cache.EhCacheProvider</property>
> 
> 		<mapping resource="com/hidden/Address.hbm.xml"/>
> 	</session-factory>
> </hibernate-configuration>

spring.properties is:
> db.url=jdbc:mysql://localhost/dbname?characterEncoding=utf8
> db.username=root
> db.password=
> db.driver=com.mysql.jdbc.Driver
> hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
> hibernate.showsql=false


-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message