I'd say - good ol' OO.
class Section {
...
ReadOnlyCollection<Question> Questions ...
void DeleteQuestion(Question q) {
questions.Remove(q);
ReorderQuestions();
}
}
now ReorderQuestions() could be as simple as looping through the questions.
once you hit a perf problem you can switch that into a more efficient SQL
update query. it would be internal to the domain model, not affecting othe
rparts of the application.
On Wed, Sep 17, 2008 at 12:27 AM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]>wrote:
>
> hi,
>
> I have a standard object that contains a collection of
> sections. Each section has a collection of questions.
>
> Each question has a display order for example:
>
> Q1's display order is 1.1
> Q2's display order is 1.2
> Q3's display order is 1.3
> Q4's display order is 1.4
>
> If I delete Q2, I need to reorder the display order so it
> reads:
> 1.1
> 1.2
> 1.3
>
> They are all Nh objects.
>
> What is the best way to handle the updates with NHibernste?
>
> >
>
--
Ken Egozi.
http://www.kenegozi.com/blog
http://www.musicglue.com
http://www.castleproject.org
http://www.gotfriends.co.il
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---