You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michal Hlavac <hl...@hlavki.sk> on 2005/09/01 09:48:04 UTC

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


Re: tapestry 4 and hibernate

Posted by Tomáš Drenčák <to...@gmail.com>.
Here's some example application
http://nemesisit.rdsnet.ro/opendocs/tapehibe2/tapehibe2.html. I
haven't look at it in details and therefore don't know if it uses the
best patterns... I think it's also good to use DAO pattern with DAO
objects as services in hivemind - look at
http://www.theserverside.com/articles/content/HivemindBuzz/article.html
there's good example of SessionFactory. There were also a discussion
which may help you - topic "Transaction handling. Where?"

tomas

2005/9/1, Michal Hlavac <hl...@hlavki.sk>:
> 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


Re: tapestry 4 and hibernate

Posted by Adam Greene <ag...@iq-2000.com>.
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" <hl...@hlavki.sk>
To: "Tapestry users" <ta...@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