The only way to not generate the bag collection is specify the association as non-persistable (under the ORM Association Detail tab in Association Specification dialog). But this will also remove the relationships between BigEntity and LittleEntity in generated ORM code.
As you mention it take lots of time to load the collection, may I know you need to load the entire collection? If you are looking for specific records, I think the criteria class can help a lot.
I need persistent relation Entity->BigEntity, Entity->LittleEntity.
As you mention it take lots of time to load the collection, may I know you need to load the entire collection?
I don’t need to load collection, it’s hibernate need: when I invoke BigEntity.AddLittleEntity(Entity, LittleEntity), hibernate proxy load entire collection.
Actually setting both From and To association end to Extra Lazy will not causing the collection being loaded when adding objects to collection. You can set the association to Extra Lazy inside the ORM Association Detail tab of the Association Specification dialog. If you require any further information, please do not hesitate to contact me again.
Hi,
Am I wrong or Nhibernate doesn’t support extra lazy association?
At the moment I bypass the “issue” in the following way:
BigEntity <----X Entity <------> LittleEntity
Pls tell me if it isn’t right.
[quote=Rain]Hello maurizio316,
Actually setting both From and To association end to Extra Lazy will not causing the collection being loaded when adding objects to collection. You can set the association to Extra Lazy inside the ORM Association Detail tab of the Association Specification dialog. If you require any further information, please do not hesitate to contact me again.