Yes, the <list> mapping type in NH does exactly that - persists the list
index to a field in the DB.
Sean

On Wed, Jan 7, 2009 at 4:11 PM, Gustavo Ringel <[email protected]>wrote:

> a many-to-many list will do the job IIRC
>
> Gustavo.
>
>
> On Wed, Jan 7, 2009 at 11:02 PM, Todd <[email protected]> wrote:
>
>>
>> I have a product object that has the usual properties like ID, name,
>> etc.  and a ContentBlock object which has an ID, a Name and a Content
>> property which represents a block of HTML.  These two objects have a
>> many-to-many relationship as a product has multiple content blocks,
>> and content blocks can be shared amongst products.
>>
>> An important distinction is that when getting the collection of
>> content blocks for a product, the order of the objects in the
>> collection is important and must be maintained when object state is
>> persisted.  Is there an easy way to map this in nHibernate so that the
>> index of the item in the list (or set or whatever) is saved in the
>> database as a "sortorder" column?  Or, should I just add another class
>> to my domain that keeps the order and resolves the many-to-many
>> relationship between the product and contentblock classes?
>>
>> Thanks,
>> Todd
>>
>>
>>
>
> >
>

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