PDA

View Full Version : Error when using Hibernate through example of Spring.Data.NHibernate.Northwind


ctlqt12
08-13-2007, 08:28 PM
Hi all,

I'm newbie of Spring.Net, and i intend to use Hibernate for interacting with database. But in Hibernate example, i have some errors about mapping person.hbm.xml with person.cs.

I feel the program seems doesn't know person.hbm.xml file because when i change something ( property name ) in person.hbm.xml file, the program doesn't run errors or anything else.

All i always receive is the datagrid that will be used for displaying data is null.

Could you tell me how could i do for displaying data in datagrid? ( I used Spring.NET-1.1-M2.zip )

Mark Pollack
08-16-2007, 09:47 PM
Hi,

Have you been able to run standard NHibernate 1.2 examples? I would start first using basic examples and tutorials that are available for NHibernate. It sounds like you have not configured Hibernate correctly to look for mapping files. This can be done via a variety of properties on LocalSessionFactoryObject, namely MappingAssemblies, MappingResources or using HibernateProperties. Check the API docs for some more details.

Once you get 'hello world' working in NHibernate, introduce Spring. If you are using NHibernate 1.2, you can use the standard NHibernate API but participate in Spring demarcated transactions.

Cheers,
Mark