Try mapping the bag with lazy="extra" On Tue, Apr 28, 2009 at 6:11 AM, Carsten Hess <[email protected]>wrote:
> > Hi nhusers, > > I was told it is possible to add an element to a collection if it is > mapped as a bag. However - I cannot make this work - it still > initializes the whole collection. Any hints ? > > Here is my mapping: > <bag name="JournalEntries" access="field.camelcase" > cascade="all" lazy="true" batch-size="100"> > <key> > <column name="debtorengagement_oid" > index="debtorengagement_oid_ix" /> > </key> > <one-to-many > class="EBH.GuG.DomainModel.Impl.Journal.JournalEntry"/> > </bag> > > > And here is a snippet of the dotTrace stacktrace (found no way to > attach an image): > > .. > NHibernate.Collection.Generic.PersistentGenericBag<T>.Add( > NHibernate.Collection.AbstractPersistentCollection.Write( > NHibernate.Collection.AbstractPersistentCollection.Initialize( > ... > ... > NHibernate.Loader.Loader.LoadCollectionBatch( > > NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections( > NHibernate.Loader.Loader.DoQuery( > NHibernate.Loader.Loader.GetResultSet( > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
