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
-~----------~----~----~----~------~----~------~--~---