PDA

View Full Version : Spring.net and Nhibernate integration


Ashesh
11-21-2006, 03:54 AM
Hi,

I am trying to integrate Spring.net and Nhibernate.

I am unable to get a reference to 'HibernateDaoSupport' interface. I have included 'Spring.Data.NHibernate.Support' namespace to my page but I have found that this interface is not a part of this namespace.

I have referred the example under Spring.Data.Nhibernate.Integration.Test.2003 as a startup point for the integration.

Any help on this would be appreciated.

Mark Pollack
11-21-2006, 07:01 AM
Hi,

Hm....I'm not sure what is the issue. 'HibernateDaoSupport' is a base class so you should inherit from it. Take a look with reflector - i'm sure you will see the class in the Spring.Data.NHibernate.dll. In anycase, you should get the latest download (http://www.springframework.net/downloads/Spring.Data.NHibernate/), I made some small bug fixes and refactoring to support nhibernate 1.2.

Be sure to add the following for configuration of spring logging


<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>


and

<common>
<logging>
<factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter , Common.Logging.Log4Net129">
<!-- choices are INLINE, FILE, FILE-WATCH, EXTERNAL-->
<!-- otherwise BasicConfigurer.Configure is used -->
<!-- log4net configuration file is specified with key configFile-->
<arg key="configType" value="EXTERNAL" />
</factoryAdapter>
</logging>
</common>


let me know if you still have issues. The Spring.Northwind example in the distribution should get you going.

Cheers,
Mark

Ashesh
11-21-2006, 08:57 AM
Mark,

Thanks, I dowloaded the latest build and now I am able to aceess 'HibernateDaoSupport'.

Cheers,
Ashesh