StatelessSession doesn't do cascade operations, AFAIK. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of mscheibler Sent: den 29 april 2009 07:57 To: nhusers Subject: [nhusers] Re: IStatelessSession.Insert and uni-directional one-to-many
Again: anybody? On 28 Apr., 10:22, mscheibler <[email protected]> wrote: > Hi Fabio, > > here are the mappings: > > <class name='TermsOfPaymentDetail'> > <id name='_persistentId' column='Id' type='System.Int64' > access='field'> > <generator class='hilo'> > <param name='table'>UniqueId</param> > <param name='column'>NextId</param> > <param name='max_lo'>50</param> > </generator> > </id> > <version name='_persistentLock' column='OptimisticLockId' > access='field' /> > <property name='Text' length='1024'> > <column name='Text' /> > </property> > <property name='PaymentTargetDays'> > <column name='PaymentTargetDays' /> > </property> > <property name='Discount'> > <column name='Discount' /> > </property> > </class> > <class name='TermsOfPayment'> > <id name='_persistentId' column='Id' type='System.Int64' > access='field'> > <generator class='hilo'> > <param name='table'>UniqueId</param> > <param name='column'>NextId</param> > <param name='max_lo'>50</param> > </generator> > </id> > <version name='_persistentLock' column='OptimisticLockId' > access='field' /> > <list name='Details' cascade='all-delete-orphan'> > <key column='TermsOfPayment' /> > <index column='Ordinal' type='System.Int32' /> > <one-to-many class='TermsOfPaymentDetail' /> > </list> > </class> > > Thanks for your help! > > Michael > > On 28 Apr., 07:08, Fabio Maulo <[email protected]> wrote: > > > > > mappings? > > > 2009/4/28 mscheibler <[email protected]> > > > > Anybody? > > > > On 27 Apr., 09:06, mscheibler <[email protected]> > > > wrote: > > > > Hello, > > > > > I have two entities, A and B, with A having a collection of B but > > > > WITHOUT B having a reference to A. > > > > Of course the database foreign key column is in table B: > > > > > class A { > > > > ICollection<B> Bs { get; } > > > > > } > > > > > class B { > > > > ... // does not have reference to A > > > > > } > > > > > table A { > > > > ID int, > > > > ... > > > > > } > > > > > table B { > > > > ID int, > > > > A_ID int, > > > > ... > > > > > } > > > > > Now I want to import a lot of As and Bs using > > > > IStatelessSession.Insert. The problem is I can only add Bs to A.Bs, > > > > but these are not inserted when I insert A. But when inserting B > > > > explicitly, A_ID always will have the value NULL. > > > > > Is there a way to come around that problem? > > > > > Thanks a lot! > > > > > Michael > > > -- > > Fabio Maulo- Zitierten Text ausblenden - > > > - Zitierten Text anzeigen -- Zitierten Text ausblenden - > > - Zitierten Text anzeigen - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
