Skip to content

Commit 3af894a

Browse files
committed
Use type instead of class name
1 parent 4cbac19 commit 3af894a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/NHibernate/Cfg/XmlHbmBinding/PropertiesBinder.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using NHibernate.Mapping;
55
using System;
66
using NHibernate.Util;
7-
using Array = System.Array;
87

98
namespace NHibernate.Cfg.XmlHbmBinding
109
{
@@ -14,7 +13,6 @@ public class PropertiesBinder : ClassBinder
1413
private readonly Component component;
1514
private readonly string entityName;
1615
private readonly System.Type mappedClass;
17-
private readonly string className;
1816
private readonly bool componetDefaultNullable;
1917
private readonly string propertyBasePath;
2018

@@ -38,7 +36,6 @@ public PropertiesBinder(Mappings mappings, PersistentClass persistentClass)
3836
this.persistentClass = persistentClass;
3937
entityName = persistentClass.EntityName;
4038
propertyBasePath = entityName;
41-
className = persistentClass.ClassName;
4239
mappedClass = persistentClass.MappedClass;
4340
componetDefaultNullable = true;
4441
component = null;
@@ -50,7 +47,6 @@ public PropertiesBinder(Mappings mappings, Component component, string className
5047
persistentClass = component.Owner;
5148
this.component = component;
5249
entityName = className;
53-
this.className = component.ComponentClassName;
5450
mappedClass = component.ComponentClass;
5551
propertyBasePath = path;
5652
componetDefaultNullable = isNullable;
@@ -116,7 +112,7 @@ public void Bind(IEnumerable<IEntityPropertyMapping> properties, Table table, ID
116112

117113
mappings.AddCollection(collection);
118114

119-
property = CreateProperty(collectionMapping, className, collection, inheritedMetas);
115+
property = CreateProperty(collectionMapping, mappedClass, collection, inheritedMetas);
120116
BindCollectionProperty(collectionMapping, property);
121117
}
122118
else if ((propertiesMapping = entityPropertyMapping as HbmProperties) != null)
@@ -428,11 +424,11 @@ private Property CreateProperty(IEntityPropertyMapping propertyMapping, System.T
428424
return property;
429425
}
430426

431-
private Property CreateProperty(IEntityPropertyMapping propertyMapping, string propertyOwnerClassName, Mapping.Collection value, IDictionary<string, MetaAttribute> inheritedMetas)
427+
private Property CreateProperty(IEntityPropertyMapping propertyMapping, System.Type propertyOwnerType, Mapping.Collection value, IDictionary<string, MetaAttribute> inheritedMetas)
432428
{
433429
if (string.IsNullOrEmpty(propertyMapping.Name))
434430
{
435-
throw new MappingException("A property mapping must define the name attribute [" + propertyOwnerClassName + "]");
431+
throw new MappingException("A property mapping must define the name attribute [" + propertyOwnerType + "]");
436432
}
437433

438434
var propertyAccessorName = GetPropertyAccessorName(propertyMapping.Access);

0 commit comments

Comments
 (0)