-->
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.  [ 1 post ] 
Author Message
 Post subject: At least one object must implement IComparable
PostPosted: Fri Nov 24, 2006 7:14 am 
Regular
Regular

Joined: Fri Nov 04, 2005 12:37 pm
Posts: 81
ASP 2.0 and NHibernate 1.2.0 beta

I have a entity class ClassA, which has a one-to-many relationship with ClassB.

When i try to add more than one instances of ClassA's collections of ClassBs i get this error:

Quote:
At least one object must implement IComparable.



So i made ClassB implement IComparable, but the problem still persists, what am i doing wrong?

Code:
public sealed class ClassB  : IComparable<ClassB>
{
     //some stuff


     public int CompareTo(ClassB obj)
     {
            return this.CompareTo(obj);
     }


}


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

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.