ISet with order-by

Description

I recently added "order-by" to the mapping for a set collection and NHibernate complained with:

"NHibernate.MappingException: Cannot use order-by with generic set, no appropriate collection implementation is available"

Checking the code, it looks like ISet<T> is generic but not sorted.

I don't think this matters since "order-by" is merely appended to the SQL that is generated as opposed to NHibernate sorting the collection after its populated.

Find attached sample mapping fragments showing a mapping that works, followed by one that throws the exception when it includes "order-by".

Environment

None

Attachments

1

Activity

Show:

Former user 
March 8, 2007 at 9:54 PM

order-by is used for collections that maintain order, and there is no such collection implementing ISet<T>. If you don't need to maintain the order, then you don't need order-by.

Not an Issue

Details

Assignee

Reporter

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created March 8, 2007 at 9:27 AM
Updated March 8, 2007 at 9:54 PM
Resolved March 8, 2007 at 9:54 PM
Who's Looking?