-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate Tools ant task for Spring
PostPosted: Wed Aug 29, 2007 6:28 am 
Newbie

Joined: Wed Aug 29, 2007 6:16 am
Posts: 2
Location: London
Hi,

We have been using the Ant task successfully for generating our reverse engineered entity beans. It has worked like a dream and we have been able to forget about the database almost completly.

The only issue is that there does not seem to be support for a spring config file. For instance the following is what I would like the reverse engineer to write to.

Code:
<!-- Hibernate SessionFactory -->
<bean id="exampleSessionFactory"
   class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource">
     <ref local="exampleDataSource"/>
</property>
<property name="hibernateProperties">
     <ref bean="exampleHibernateProperties" />
</property>
<!--  OR mapping files. -->
<property name="mappingResources">
    <list>
       <value>Customer.hbm.xml</value>
       <value>Account.hbm.xml</value>
    </list>
</property>
</bean> 


Although we are successfully using the hibernate.cfg.xml it does seem neater to use the spring integration.

Does anyone have any tips or should I copy out the reverse engineered mappings into the spring config file?

Thanks

Nick


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 29, 2007 6:42 am 
Newbie

Joined: Wed Aug 29, 2007 6:16 am
Posts: 2
Location: London
Quoting -- "Or you could leave the hibernate configuration in hibernate.cfg.xml and use the configLocation property of the LocalSessionFactoryBean. That way you'd just have one configuration that you can use for both, only that it's not in the applicationContext.xml file.

hth,

Lutz"

I found this post and this makes allot of sense and achieves what I wanted..

Sorry for the wasted post.

Nick


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.