tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Greene" <agre...@iq-2000.com>
Subject Re: tapestry 4 and hibernate
Date Thu, 01 Sep 2005 19:11:29 GMT
Have you looked at using Hivetranse?  http://hivetranse.sourceforge.net/

It can be tricky at times.  the documentation at the site wasn't obvious on 
the some of the config stuff.   So here is what I use for configuration in 
hivemodule.xml, if it is of interest to you :-)

 <configuration-point id="HibernateConfig" 
schema-id="hivetranse.hibernate3.HibernateSettingsSchema">
 </configuration-point>

 <contribution configuration-id="HibernateConfig">
        <property name="hibernate.connection.url" 
value="jdbc:mysql://localhost/database" />
        <property name="hibernate.cglib.use_reflection_optimizer" 
value="true" />
        <property name="hibernate.transaction.factory_class" 
value="org.hibernate.transaction.JDBCTransactionFactory" />
        <property name="hibernate.connection.username" value="user" />
        <property name="hibernate.connection.password" value="pass" />
        <property name="hibernate.connection.driver_class" 
value="org.gjt.mm.mysql.Driver" />
        <property name="hibernate.dialect" 
value="org.hibernate.dialect.MySQLDialect" />
        <property name="hibernate.c3p0.acquire_increment" value="3" />
        <property name="hibernate.c3p0.idle_test_period" value="30" />
        <property name="hibernate.c3p0.timeout" value="60" />
        <property name="hibernate.c3p0.max_size" value="30" />
        <property name="hibernate.c3p0.max_statements" value="5" />
        <property name="hibernate.c3p0.min_size" value="5" />
 <mapping class="de.gmx.om.Item"/>
 </contribution>

 <contribution configuration-id="hivetranse.core.TransactionDefaults">
  <defaults>
   <exception name="java.lang.Throwable" rollback="true" />
   <method pattern="*" demarcation="Supports" /> <!-- by default what 
dermarcation should all methods use -->
  </defaults>
 </contribution>

 <service-point id="HibernateSession"
  interface="org.hibernate.Session">
  <invoke-factory service-id="hivetranse.hibernate3.SessionFactory" 
model="singleton">
   <config configuration-id="HibernateConfig"/>
  </invoke-factory>
 </service-point>


 <service-point id="UserDAO" interface="UserDAO">
  <invoke-factory>
   <construct class="impl.UserDAOImpl">
    <service>HibernateSession</service>
   </construct>
  </invoke-factory>
  <interceptor service-id="hivetranse.core.TransactionInterceptor">
   <method pattern="*" demarcation="Required"/>
  </interceptor>
 </service-point>

 <contribution configuration-id="hivemind.EagerLoad">
  <load service-id="HibernateSession" />
 </contribution>

----- Original Message ----- 
From: "Michal Hlavac" <hlavki@hlavki.sk>
To: "Tapestry users" <tapestry-user@jakarta.apache.org>
Sent: Thursday, September 01, 2005 4:48 AM
Subject: tapestry 4 and hibernate


> hello,
>
> is there some example (tutorial) to use hibernate with tapestry 4???
>
> thanks, miso
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Mime
View raw message