File tree 2 files changed +17
-12
lines changed
NHibernate.Test/NHSpecificTest/NH1584
2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 6
6
7
7
namespace NHibernate . Test . NHSpecificTest . NH1584
8
8
{
9
- [ TestFixture , Ignore ( "Not supported yet." ) ]
9
+ [ TestFixture ]
10
10
public class TestFixture : BugTestCase
11
11
{
12
- public override string BugNumber
13
- {
14
- get { return "NH1584" ; }
15
- }
16
-
17
12
protected override void OnTearDown ( )
18
13
{
19
14
using ( ISession session = OpenSession ( ) )
Original file line number Diff line number Diff line change @@ -12,25 +12,35 @@ internal sealed class AssociationKey
12
12
{
13
13
private readonly EntityKey ownerKey ;
14
14
private readonly string propertyName ;
15
+ private readonly int hashCode ;
15
16
16
17
public AssociationKey ( EntityKey ownerKey , string propertyName )
17
18
{
18
19
this . ownerKey = ownerKey ;
19
20
this . propertyName = propertyName ;
21
+ hashCode = ownerKey . GetHashCode ( ) ^ propertyName . GetHashCode ( ) ^ ownerKey . EntityName . GetHashCode ( ) ;
20
22
}
21
23
22
24
public override bool Equals ( object that )
23
25
{
24
- if ( this == that ) return true ;
26
+ // NH : Different behavior for NH-1584
27
+ if ( this == that )
28
+ {
29
+ return true ;
30
+ }
25
31
26
- AssociationKey key = that as AssociationKey ;
27
- if ( key == null ) return false ;
28
- return key . propertyName . Equals ( propertyName ) && key . ownerKey . Equals ( ownerKey ) ;
32
+ var key = that as AssociationKey ;
33
+ if ( key == null )
34
+ {
35
+ return false ;
36
+ }
37
+ return key . propertyName . Equals ( propertyName ) && key . ownerKey . Equals ( ownerKey )
38
+ && key . ownerKey . EntityName . Equals ( ownerKey . EntityName ) ;
29
39
}
30
40
31
41
public override int GetHashCode ( )
32
42
{
33
- return ownerKey . GetHashCode ( ) ^ propertyName . GetHashCode ( ) ;
43
+ return hashCode ;
34
44
}
35
45
}
36
- }
46
+ }
You can’t perform that action at this time.
0 commit comments