Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » RCP + Spring + Hibernate2 = Problem
RCP + Spring + Hibernate2 = Problem [message #465249] Mon, 26 March 2007 22:07 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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>
Re: RCP + Spring + Hibernate2 = Problem [message #465275 is a reply to message #465269] Wed, 28 March 2007 03:58 Go to previous message
Eclipse UserFriend
Originally posted by: mmccaskill.healthdec.com

I found this:

http://java.smartit.info/downloads/index.html

But I couldn't make it work.

This seems hopeless. If I can't use autowire I guess I'll have to manually set beans by using the static plugin-referenced BeanFactory approach. But I'd hate to integrate BeanFactory everywhere.
Previous Topic:plugin menu
Next Topic:Problem with getting list of installed plugins
Goto Forum:
  


Current Time: Wed Sep 18 05:39:47 GMT 2024

Powered by FUDForum. Page generated in 0.03699 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top