| Author |
getHibernateTemplate()
|
Arun Kumarr
Ranch Hand
Joined: May 16, 2005
Posts: 508
|
|
Hai, How does getHibernateTemplate() work? In my DAO I really don't specify any path where my Spring-Hibernate.config.xml is? On googling I found that getHibernateTemplate() method reads the Session parameters from the beans in ApplicationContext. How exactly does that it read the details from my xml file without knowing it's location? [ December 22, 2005: Message edited by: Arun Kumarr ]
|
If you are not laughing at yourself, then you just didn't get the joke.
|
 |
Ken Krebs
Ranch Hand
Joined: Nov 27, 2002
Posts: 451
|
|
|
It doesn't need to. That is the job of Hibernate's SessionFactory which produces the Hibernate Sessions that HibernateTemplate uses.
|
kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg
|
 |
Arun Kumarr
Ranch Hand
Joined: May 16, 2005
Posts: 508
|
|
I use hibernate with Springs. Thanks a lot for the reply. I tried to instantiate My DAO using new, instead of asking Spring to get it. Now when java gets it doesn't set the properties of the My DAO, say the "sessionFactory". It was working fine then. [ January 05, 2006: Message edited by: Arun Kumarr ]
|
 |
tejaswini patwardhan
Greenhorn
Joined: Oct 17, 2004
Posts: 3
|
|
I want to use struts+hibernate+spring.I am encorporating spring thru' hibernateDAOSupport and applicationContext.xml file.Else flow of struts remains the same. The problem am facing is the getHibernateTemplate() method is returning null even if i wrote the bean of DAO correctly pointing to hibernateTemplate in applicationContext.xml file. I think server is not loading the this context file. So wt to do ? in web.xml any changes needed?
|
 |
Ken Krebs
Ranch Hand
Joined: Nov 27, 2002
Posts: 451
|
|
|
It's hard to tell what's going on without seeing your applicationContext.xml file.
|
 |
 |
|
|
subject: getHibernateTemplate()
|
|
|