You mean .Add(item1) .Add(item2) and the resulting list isn't ordered by SETR_ORDER and inserts occur in the order that you added, not in the order you want it to be sorted?
Is that what you mean, or am I making assumptions? A bit more clarification would be fine. Tuna Toksöz Eternal sunshine of the open source mind. http://devlicio.us/blogs/tuna_toksoz http://tunatoksoz.com http://twitter.com/tehlike On Wed, Jul 15, 2009 at 8:16 PM, Rui Guimaraes <[email protected]>wrote: > > Hi, > > I am trying to do something I would consider very simple, but I am not > being able to do it. I am a rather newbie at nhibernate but I have > looked for an answer in previous posts and other web pages and I am > not being been able to solve my problem (at least the way I want to). > > I have 3 tables (lets make the problem simple) > > TRACKS (ID, NAME) > PATHS (ID, NAME) > TRACK_PATHS (TRACK_ID, PATH_ID, TRACK_ORDER) > > and two class object > Track > Path > > I simply want to, on my Path, have the Tracks in an ordered List. So > far so good... in my mapping I use the "order-by" by TRACK_ORDER. > > But when inserting values to my list I am not being able to persist > the order. Can any help me? > > My mapping is like this: > > <bag name="TrackList" table="PATHS_TRACKS" cascade="none" lazy="true" > inverse="false" order-by="SETR_ORDER ASC" collection- > type="Opt.Gist.Network.Domain.Collections.ObservableList`1 > [[Opt.Gist.Network.Domain.Track, Opt.Gist.Network.Domain]], > Opt.Gist.Network.Domain"> > <key column="PATH__ID"/> > <many-to-many > class="Opt.Gist.Network.Domain.Track,Opt.Gist.Network.Domain" > column="TRACK_ID"/> > </bag> > > > > The list in the Path object that I have is the following, and this is > the list that I add my tracks to: > > virtual public IObservableList<Track> TrackList > { > get > { > return (IObservableList<Track>)_trackList; > } > > set > { > _isChanged |= (_trackList != value); > _trackList = value; > } > } > > > NOTE: I want to solve this without having another class. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
