
Originally Posted by
skadiy000
Hi
I am using Spring 2.5 with Webflow 2.0.3 and Hibernate 3.x
For the Hibernate session factory, I have written a HibernateUtils static class that returns SessionFactory.
Can we write static classes in spring?
am I in the right direction?
Appreciate inputs.
Thanks
If I remember correctly, the Hibernate tutorial demonstrates the use of a "HibernateUtil" class that has a static method to fetch the Session Factory.
This is how you could declare your Session Factory (using this HibernateUtil that is discussed in the Hibernate tutorial) in your spring beans document:
Code:
<beans>
...
<bean id="sessionFactory" class="util.HibernateUtil" factory-method="getSessionFactory" />
...
</beans>
Using a static factory method is discussed here: http://static.springframework.org/sp...factory-method