These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Cannot use order-by with generic set
PostPosted: Fri Sep 15, 2006 6:10 am 
Beginner
Beginner

Joined: Tue Jun 06, 2006 4:47 am
Posts: 25
I'm using NHibernate-1.2.0.Alpha1-debug with .Net 2.0
I can see why this error is happening, but I dont know how to get round it,

My Mapping file contains
Code:
      <!-- A list of items belonging to this invoice header -->
      <set name="items" table="tblinvoiceitems" order-by="itemnumber">
         <key column="headerptr"/>
         <one-to-many class="invoiceItem"/>
      </set>


And my Invoiceheader class contains.

Code:
private ICollection<invoiceItem> _items;
public virtual ICollection<invoiceItem> items
{
   get {
      return _items;
   }
   set { _items = value; }
}


So my question is, how do I get sorted sets to work with .NET 2 & NHibernate-1.2.0.Alpha1-debug ?
Can I use .Net 2.0 collections ?
Do I have to use iesi ?

Many thanks


Top
 Profile  
 
 Post subject: I'm having the same problem
PostPosted: Wed Apr 11, 2007 9:53 am 
Newbie

Joined: Wed Jan 31, 2007 5:26 am
Posts: 8
Location: Tel Aviv, Israel
It was also asked in the JIRA (http://jira.nhibernate.org/browse/NH-939)

Sergey Koshcheyev said:
Quote:
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.


But in that case, there is a problem for using a collection that don't persist the order (no index column in db), but do want to retrieve the elements in a specific order.

And suggestions?

Cheers,
Tomer.

_________________
Tomer Avissar.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.