You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kalle Korhonen <ka...@gmail.com> on 2009/04/23 00:22:18 UTC
Re: Changing default hibernate.cfg.xml
Maybe you found an answer to this already, but you need to disable the
default configuration first (
http://tapestry.apache.org/tapestry5/tapestry-hibernate/conf.html). But I
agree, it might make more sense that you'd just be able to override the
value for the default filename. At least for me, it's a typical scenario
that you run the app in test mode against hsql but in production mode
against derby/mysql.
Kalle
On Tue, Jan 29, 2008 at 8:27 AM, Moritz Gmelin <mo...@gmx.de> wrote:
> Hi,
>
> I have multiple services invoved in my web-application that are used in
> other sub-projects too. That's why it would be useful to be able to
> manually set the file name for the hibernate configuration to be used
> (default is always hibernate.cfg.xml).
>
> I tried to do the following in AppModule
>
>
> public void contributeHibernateSessionSource
> (OrderedConfiguration<HibernateConfigurer> conf) {
> class MHibernateConfigurer implements HibernateConfigurer {
>
> public void
> configure(org.hibernate.cfg.Configuration configuration) {
> configuration.configure("hibernate_foo.cfg.xml");
>
> }
> };
>
> conf.add("Default", new MHibernateConfigurer());
> }
>
> But it tells me that the "Default" Configuration is already there and it
> cannot be changed.
> Is there another way I can achieve this?
>
> Regards
>
> Moritz