-->
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.  [ 4 posts ] 
Author Message
 Post subject: VB.net, Composite-ID and override equals
PostPosted: Fri Jun 30, 2006 3:56 am 
Newbie

Joined: Fri Jun 30, 2006 3:48 am
Posts: 3
I am trying to create a hibernate mapping that has a composite-id and a VB.net class that corresponds to that.
The error that I am getting is that I need to override the equals method. VB.net doesn't allow me to override the equals method. I can only overload it or set it to 'shadows'.
Does anyone have experience with this?


Top
 Profile  
 
 Post subject: Solved
PostPosted: Fri Jun 30, 2006 4:29 am 
Newbie

Joined: Fri Jun 30, 2006 3:48 am
Posts: 3
Solved it by using "shadows" and by using the method "Equals" and not "equals".

These are the best answers, the ones you can find yourself.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 30, 2006 4:29 am 
Beginner
Beginner

Joined: Wed Aug 10, 2005 6:21 pm
Posts: 24
Location: Antwerp, Belgium
That's odd. I use vb.net and I have no problems overriding Equals.

Code:
   Public Overrides Function Equals(ByVal obj As Object) As Boolean
        If obj Is Me Then Return True
        ...
    End Function


Are you perhaps inheriting from a base class that already shadows Equals() ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 30, 2006 4:53 am 
Newbie

Joined: Fri Jun 30, 2006 3:48 am
Posts: 3
No, it is just a simple class, it does not inherits another. Maybe this is related to the version of the dotnet framework that I am using? (1.1)

After installing Visual Studio 2005, I can also override the function, but it doesn't seem to be the case in VS2003.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.