RCP + Spring + Hibernate2 = Problem [message #465249] |
Mon, 26 March 2007 22:07 |
Eclipse User |
|
|
|
Originally posted by: mmccaskill.healthdec.com
I created a RCP view and want Spring to pass my DAO (which uses Hibernate) to the view. My applicationContext file uses auto-wire but I cannot seem to get Spring to pass the DAO to the view.
Any suggestions?
|
|
|
Re: RCP + Spring + Hibernate2 = Problem [message #465269 is a reply to message #465249] |
Tue, 27 March 2007 17:25 |
Eclipse User |
|
|
|
Originally posted by: mmccaskill.healthdec.com
Anyone had any success with Spring autowire and Eclipse RCP?
I can make it work by saving the BeanFactory in the plugin class through a BeanFactoryLocator and BeanFactoryReference, then using the BeanFactory to explicitly retrieve "myDAO". But I'd like autowire to work.
package com.test.ui.views;
public class MyView extends ViewPart {
private MyDAO myDAO;
public void setMyDAO(MyDAO myDAO) {this.myDAO = myDAO;}
}
-----
applicationContext.xml
<beans default-autowire="byName">
<bean id="myDAO" class="com.test.dao.MyDAO"/>
<bean id="myView" class="com.test.ui.views.MyView"/>
</beans>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03699 seconds