You could use a sorted collection - as opposed to an ordered collection.
 Then the elements are sorted in-memory instead of from the DB and new
elements would be placed in the correct location.  See
http://nhforge.org/doc/nh/en/index.html#collections-sorted for the details.

Sean Carpenter

On Tue, Oct 28, 2008 at 6:00 AM, codemonkey <[EMAIL PROTECTED]> wrote:

>
> Hello,
>
> I have a bag of items like so:
>
> <bag name="StudyPlanNotes" inverse="true" lazy="true" cascade="save-
> update" order-by="CreatedDate DESC">
>      <key column="StudyPlanId" />
>      <one-to-many class="StudyPlanNote, Domain" />
> </bag>
>
> Works fine with an SQL sort which is what I would like I guess here
> comes my issue, I add a new note to a loaded StudyPlan object and
> persist it back, I then do a select again of the item and due to being
> in the session I get the same object returned with the new note at the
> bottom of the list. I could evict the entity I guess to force a new
> select and ordering the notes.
>
> At the moment in my presenter I am calling a LINQ to Objects OrderBy
> on the IList which is working but was wondering if there is a better
> way to have the collection sorted better or have I done all I can do?
>
>
> Cheers
> >
>

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

Reply via email to