jojorico wrote:
Hibernate version: NHibernate v1.0.2
Mapping documents:
1. Item.hbm.xml
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="nhExhibition.Business.Item, nhExhibition.Business" table="Item">
I have these 2 hbm files which have many relationships with other classes.
While i'm enabling the lazy loading "lazy=true", all the collection objects of the Category class are being loaded, but the problem is that these collections also are loading their own collections .. which resuult of loading all the database !!!
How can we fix that problem ?
First of all, How do You determine that the lists are loaded by default? By monitoring SQL database activity? Using debugger do inspect properties does trigger lazy loading...
Second, as You are using version 1.0.2, You might want to add lazy="true" to class mapping also... Or consider using never version of NHibernate (next beta should be out soon)
jojorico wrote:
Beside, while using the property names in the HQL to retrieve properties, the resultant IList objects have a structure that does not fit with the GridViews data fields ! The list of objects retrieved does not have a property to Use !! What about that ?
Sorry, I've not yet tried to use the data binding... But there are quite many posts in this forum about using NHibernate data with data binding.
Gert