cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lowe <mel...@gmail.com>
Subject Re: Questions on CHS (Cocoon, Hibernate, Spring) petstore project
Date Mon, 11 Apr 2005 09:37:31 GMT
using a hibernate.properties file will let you do what you want. Its
not the same as the deprecated use of hibernate.properties that you
read in the hibernate docs, you can configure properties easily in
spring to configure whatever you like. There are numerous examples of
this in spring documentation.

Mark

On Apr 11, 2005 11:25 AM, Jonny Becker <jonnypony666@hotmail.com> wrote:
> Hi,
> 
> thanks for the quick response.
> But what does this tell me? It's your configuration and it gives me some
> more hints how I could confiure this?
> 
> But the questions aren't answerd and still remain.
> 
> This looks like there is hibernate configuration everywhere in your
> different files. Do I really need this mix? Can't I just somewhere refer to
> my hibernate.cfg.xml.
> 
> cheers
> Jonny
> 
> >From: Leszek Gawron <lgawron@mobilebox.pl>
> >Reply-To: users@cocoon.apache.org
> >To: users@cocoon.apache.org
> >Subject: Re: Questions on CHS (Cocoon, Hibernate, Spring) petstore project
> >Date: Mon, 11 Apr 2005 10:59:27 +0200
> >
> >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
> >
> 
> _________________________________________________________________
> Machen Sie lästigen E-Mails ein Ende. MSN Hotmail mit Junk-Mail-Filter.
> http://www.msn.de/antispam/prevention/junkmailfilter Jetzt kostenlos
> anmelden!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
>

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


Mime
View raw message