|
From: <fab...@us...> - 2009-01-30 17:35:26
|
Revision: 4006
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4006&view=rev
Author: fabiomaulo
Date: 2009-01-30 17:35:22 +0000 (Fri, 30 Jan 2009)
Log Message:
-----------
Fix NH-1584 by Seth Schubert
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Engine/AssociationKey.cs
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/TestFixture.cs
Modified: trunk/nhibernate/src/NHibernate/Engine/AssociationKey.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Engine/AssociationKey.cs 2009-01-27 15:01:15 UTC (rev 4005)
+++ trunk/nhibernate/src/NHibernate/Engine/AssociationKey.cs 2009-01-30 17:35:22 UTC (rev 4006)
@@ -12,25 +12,35 @@
{
private readonly EntityKey ownerKey;
private readonly string propertyName;
+ private readonly int hashCode;
public AssociationKey(EntityKey ownerKey, string propertyName)
{
this.ownerKey = ownerKey;
this.propertyName = propertyName;
+ hashCode = ownerKey.GetHashCode() ^ propertyName.GetHashCode() ^ ownerKey.EntityName.GetHashCode();
}
public override bool Equals(object that)
{
- if(this==that) return true;
+ // NH : Different behavior for NH-1584
+ if (this == that)
+ {
+ return true;
+ }
- AssociationKey key = that as AssociationKey;
- if(key==null) return false;
- return key.propertyName.Equals(propertyName) && key.ownerKey.Equals(ownerKey);
+ var key = that as AssociationKey;
+ if (key == null)
+ {
+ return false;
+ }
+ return key.propertyName.Equals(propertyName) && key.ownerKey.Equals(ownerKey)
+ && key.ownerKey.EntityName.Equals(ownerKey.EntityName);
}
public override int GetHashCode()
{
- return ownerKey.GetHashCode() ^ propertyName.GetHashCode();
+ return hashCode;
}
}
-}
+}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/TestFixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/TestFixture.cs 2009-01-27 15:01:15 UTC (rev 4005)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/TestFixture.cs 2009-01-30 17:35:22 UTC (rev 4006)
@@ -6,14 +6,9 @@
namespace NHibernate.Test.NHSpecificTest.NH1584
{
- [TestFixture, Ignore("Not supported yet.")]
+ [TestFixture]
public class TestFixture : BugTestCase
{
- public override string BugNumber
- {
- get { return "NH1584"; }
- }
-
protected override void OnTearDown()
{
using (ISession session = OpenSession())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|