Skip to content

Commit ee08c70

Browse files
author
James Gregory
committed
Revert "Merge pull request #116 from firo222/master"
This reverts commit 3c48bf8, reversing changes made to dbbdb3f.
1 parent 3c48bf8 commit ee08c70

File tree

3 files changed

+5
-49
lines changed

3 files changed

+5
-49
lines changed

src/FluentNHibernate.Testing/DomainModel/Mapping/CompositeIdentityPartTester.cs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -159,26 +159,6 @@ public void MixedKeyPropertyAndManyToOneOrdering()
159159
.RootElement.Element("class/composite-id/*[2]")
160160
.HasName("key-property");
161161
}
162-
163-
[Test]
164-
public void CompositeIdWithSubclass()
165-
{
166-
new MappingTester<CompIdTarget>()
167-
.SubClassMapping<ComIdSubclass>(s =>
168-
{
169-
s.Table("subclasstable");
170-
s.KeyColumn("subclass_longId");
171-
s.KeyColumn("subclass_nullablelongId");
172-
})
173-
.ForMapping(c => c.CompositeId()
174-
.KeyProperty(x => x.LongId)
175-
.KeyProperty(x => x.NullableLongId))
176-
.Element("class/joined-subclass/key/*[1]")
177-
.Exists().HasName("column").HasAttribute("name", "subclass_longId")
178-
.RootElement.Element("class/joined-subclass/key/*[2]")
179-
.Exists().HasName("column").HasAttribute("name", "subclass_nullablelongId")
180-
;
181-
}
182162

183163
public class CompIdTarget
184164
{
@@ -203,10 +183,5 @@ public class ComponentKey
203183
public virtual int KeyCol1 { get; set; }
204184
public virtual int KeyCol2 { get; set; }
205185
}
206-
207-
public class ComIdSubclass : CompIdTarget
208-
{
209-
210-
}
211186
}
212187
}

src/FluentNHibernate/MappingModel/Collections/AttributeLayeredValues.cs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,14 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4-
using System.Runtime.Serialization;
54

65
namespace FluentNHibernate.MappingModel.Collections
76
{
87
[Serializable]
9-
public class AttributeLayeredValues : ISerializable
8+
public class AttributeLayeredValues
109
{
11-
readonly Dictionary<string, LayeredValues> inner;
10+
readonly Dictionary<string, LayeredValues> inner = new Dictionary<string, LayeredValues>();
1211

13-
public AttributeLayeredValues()
14-
{
15-
inner = new Dictionary<string, LayeredValues>();
16-
}
17-
18-
public AttributeLayeredValues(SerializationInfo info, StreamingContext context)
19-
{
20-
inner = (Dictionary<string, LayeredValues>)info
21-
.GetValue("inner", typeof(Dictionary<string, LayeredValues>));
22-
inner.OnDeserialization(this);
23-
}
24-
2512
public LayeredValues this[string attribute]
2613
{
2714
get
@@ -103,10 +90,5 @@ public override int GetHashCode()
10390

10491
return hashCode;
10592
}
106-
107-
public void GetObjectData(SerializationInfo info, StreamingContext context)
108-
{
109-
info.AddValue("inner", inner);
110-
}
11193
}
11294
}

src/FluentNHibernate/MappingModel/ColumnMapping.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,13 @@ public ColumnMapping Clone()
9494

9595
public bool Equals(ColumnMapping other)
9696
{
97-
return (other != null) &&
98-
Equals(other.attributes, attributes) &&
99-
Equals(other.Member, Member);
97+
return Equals(other.attributes, attributes) && Equals(other.Member, Member);
10098
}
10199

102100
public override bool Equals(object obj)
103101
{
104-
return Equals(obj as ColumnMapping);
102+
if (obj.GetType() != typeof(ColumnMapping)) return false;
103+
return Equals((ColumnMapping)obj);
105104
}
106105

107106
public override int GetHashCode()

0 commit comments

Comments
 (0)