Skip to content

Commit

Permalink
Revert "Merge pull request #116 from firo222/master"
Browse files Browse the repository at this point in the history
This reverts commit 3c48bf8, reversing
changes made to dbbdb3f.
  • Loading branch information
jagregory authored and James Gregory committed Apr 27, 2012
1 parent 3c48bf8 commit 3acc7b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,26 +159,6 @@ public void MixedKeyPropertyAndManyToOneOrdering()
.RootElement.Element("class/composite-id/*[2]")
.HasName("key-property");
}

[Test]
public void CompositeIdWithSubclass()
{
new MappingTester<CompIdTarget>()
.SubClassMapping<ComIdSubclass>(s =>
{
s.Table("subclasstable");
s.KeyColumn("subclass_longId");
s.KeyColumn("subclass_nullablelongId");
})
.ForMapping(c => c.CompositeId()
.KeyProperty(x => x.LongId)
.KeyProperty(x => x.NullableLongId))
.Element("class/joined-subclass/key/*[1]")
.Exists().HasName("column").HasAttribute("name", "subclass_longId")
.RootElement.Element("class/joined-subclass/key/*[2]")
.Exists().HasName("column").HasAttribute("name", "subclass_nullablelongId")
;
}

public class CompIdTarget
{
Expand All @@ -203,10 +183,5 @@ public class ComponentKey
public virtual int KeyCol1 { get; set; }
public virtual int KeyCol2 { get; set; }
}

public class ComIdSubclass : CompIdTarget
{

}
}
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;

namespace FluentNHibernate.MappingModel.Collections
{
[Serializable]
public class AttributeLayeredValues : ISerializable
public class AttributeLayeredValues
{
readonly Dictionary<string, LayeredValues> inner;
readonly Dictionary<string, LayeredValues> inner = new Dictionary<string, LayeredValues>();

public AttributeLayeredValues()
{
inner = new Dictionary<string, LayeredValues>();
}

public AttributeLayeredValues(SerializationInfo info, StreamingContext context)
{
inner = (Dictionary<string, LayeredValues>)info
.GetValue("inner", typeof(Dictionary<string, LayeredValues>));
inner.OnDeserialization(this);
}

public LayeredValues this[string attribute]
{
get
Expand Down Expand Up @@ -103,10 +90,5 @@ public override int GetHashCode()

return hashCode;
}

public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("inner", inner);
}
}
}
7 changes: 3 additions & 4 deletions src/FluentNHibernate/MappingModel/ColumnMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,13 @@ public ColumnMapping Clone()

public bool Equals(ColumnMapping other)
{
return (other != null) &&
Equals(other.attributes, attributes) &&
Equals(other.Member, Member);
return Equals(other.attributes, attributes) && Equals(other.Member, Member);
}

public override bool Equals(object obj)
{
return Equals(obj as ColumnMapping);
if (obj.GetType() != typeof(ColumnMapping)) return false;
return Equals((ColumnMapping)obj);
}

public override int GetHashCode()
Expand Down

0 comments on commit 3acc7b5

Please sign in to comment.