Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public void Access(Accessor accessor)
AccessorCalled = true;
}

public void Access<T>() where T : IPropertyAccessor, new()
{

}

public void Access(System.Type accessorType)
{

Expand Down
14 changes: 13 additions & 1 deletion src/NHibernate/Mapping/ByCode/IAccessorPropertyMapper.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using NHibernate.Properties;

namespace NHibernate.Mapping.ByCode
{
public enum Accessor
Expand All @@ -6,12 +8,22 @@ public enum Accessor
Field,
NoSetter,
ReadOnly,
None
None,
//NH-3720
FieldCamelCase,
FieldCamelCaseUnderscore,
FieldCamelCaseMUnderscore,
FieldLowerCase,
FieldLowerCaseUnderscore,
FieldPascalCaseUnderscore,
FieldPascalCaseM,
FieldPascalCaseMUnderscore
}

public interface IAccessorPropertyMapper
{
void Access(Accessor accessor);
void Access(System.Type accessorType);
void Access<T>() where T : IPropertyAccessor, new();
}
}
30 changes: 30 additions & 0 deletions src/NHibernate/Mapping/ByCode/Impl/AccessorPropertyMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,41 @@ public void Access(Accessor accessor)
case Accessor.None:
setAccessor("none");
break;
//NH-3720
case Accessor.FieldCamelCase:
setAccessor("field.camelcase");
break;
case Accessor.FieldCamelCaseMUnderscore:
setAccessor("field.camelcase-m-underscore");
break;
case Accessor.FieldCamelCaseUnderscore:
setAccessor("field.camelcase-underscore");
break;
case Accessor.FieldLowerCase:
setAccessor("field.lowercase");
break;
case Accessor.FieldLowerCaseUnderscore:
setAccessor("field.lowercase-underscore");
break;
case Accessor.FieldPascalCaseM:
setAccessor("field.pascalcase-m");
break;
case Accessor.FieldPascalCaseUnderscore:
setAccessor("field.pascalcase-underscore");
break;
case Accessor.FieldPascalCaseMUnderscore:
setAccessor("field.pascalcase-m-underscore");
break;
default:
throw new ArgumentOutOfRangeException("accessor");
}
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void Access(System.Type accessorType)
{
if (!canChangeAccessor)
Expand Down
6 changes: 6 additions & 0 deletions src/NHibernate/Mapping/ByCode/Impl/AnyMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Reflection;
using NHibernate.Cfg.MappingSchema;
using NHibernate.Properties;
using NHibernate.Type;

namespace NHibernate.Mapping.ByCode.Impl
Expand Down Expand Up @@ -59,6 +60,11 @@ public void Access(Accessor accessor)
entityPropertyMapper.Access(accessor);
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void Access(System.Type accessorType)
{
entityPropertyMapper.Access(accessorType);
Expand Down
6 changes: 6 additions & 0 deletions src/NHibernate/Mapping/ByCode/Impl/BagMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Reflection;
using NHibernate.Cfg.MappingSchema;
using NHibernate.Persister.Collection;
using NHibernate.Properties;
using NHibernate.UserTypes;

namespace NHibernate.Mapping.ByCode.Impl
Expand Down Expand Up @@ -211,6 +212,11 @@ public void Access(Accessor accessor)
entityPropertyMapper.Access(accessor);
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void Access(System.Type accessorType)
{
entityPropertyMapper.Access(accessorType);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Reflection;
using NHibernate.Properties;

namespace NHibernate.Mapping.ByCode.Impl
{
Expand All @@ -23,6 +24,11 @@ public void Access(Accessor accessor)
_realMapper.Access(accessor);
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void Access(System.Type accessorType)
{
_realMapper.Access(accessorType);
Expand Down
6 changes: 6 additions & 0 deletions src/NHibernate/Mapping/ByCode/Impl/ComponentAsIdMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq;
using System.Reflection;
using NHibernate.Cfg.MappingSchema;
using NHibernate.Properties;

namespace NHibernate.Mapping.ByCode.Impl
{
Expand Down Expand Up @@ -40,6 +41,11 @@ public void Access(System.Type accessorType)
accessorPropertyMapper.Access(accessorType);
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void Class(System.Type componentType)
{
id.@class = componentType.GetShortClassName(mapDoc);
Expand Down
6 changes: 6 additions & 0 deletions src/NHibernate/Mapping/ByCode/Impl/ComponentElementMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq;
using System.Reflection;
using NHibernate.Cfg.MappingSchema;
using NHibernate.Properties;

namespace NHibernate.Mapping.ByCode.Impl
{
Expand Down Expand Up @@ -92,6 +93,11 @@ public void Access(Accessor accessor)
// not supported by HbmCompositeElement
}

public void Access<T>() where T : IPropertyAccessor, new()
{
// not supported by HbmCompositeElement
}

public void Access(System.Type accessorType)
{
// not supported by HbmCompositeElement
Expand Down
6 changes: 6 additions & 0 deletions src/NHibernate/Mapping/ByCode/Impl/ComponentMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq;
using System.Reflection;
using NHibernate.Cfg.MappingSchema;
using NHibernate.Properties;

namespace NHibernate.Mapping.ByCode.Impl
{
Expand Down Expand Up @@ -89,6 +90,11 @@ public void Access(Accessor accessor)
_accessorPropertyMapper.Access(accessor);
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void Access(System.Type accessorType)
{
_accessorPropertyMapper.Access(accessorType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq;
using System.Reflection;
using NHibernate.Cfg.MappingSchema;
using NHibernate.Properties;

namespace NHibernate.Mapping.ByCode.Impl
{
Expand Down Expand Up @@ -94,6 +95,11 @@ public void Access(Accessor accessor)
_accessorPropertyMapper.Access(accessor);
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void Access(System.Type accessorType)
{
_accessorPropertyMapper.Access(accessorType);
Expand Down
6 changes: 6 additions & 0 deletions src/NHibernate/Mapping/ByCode/Impl/ComponentParentMapper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Reflection;
using NHibernate.Cfg.MappingSchema;
using NHibernate.Properties;

namespace NHibernate.Mapping.ByCode.Impl
{
Expand All @@ -25,6 +26,11 @@ public void Access(Accessor accessor)
accessorPropertyMapper.Access(accessor);
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void Access(System.Type accessorType)
{
accessorPropertyMapper.Access(accessorType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq.Expressions;
using System.Reflection;
using NHibernate.Persister.Collection;
using NHibernate.Properties;
using NHibernate.UserTypes;

namespace NHibernate.Mapping.ByCode.Impl.CustomizersImpl
Expand Down Expand Up @@ -138,6 +139,11 @@ public void Access(System.Type accessorType)
CustomizersHolder.AddCustomizer(PropertyPath, (ICollectionPropertiesMapper x) => x.Access(accessorType));
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void OptimisticLock(bool takeInConsiderationForOptimisticLock)
{
CustomizersHolder.AddCustomizer(PropertyPath, (ICollectionPropertiesMapper x) => x.OptimisticLock(takeInConsiderationForOptimisticLock));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using NHibernate.Properties;

namespace NHibernate.Mapping.ByCode.Impl.CustomizersImpl
{
Expand Down Expand Up @@ -34,6 +35,11 @@ public void Access(Accessor accessor)
CustomizersHolder.AddCustomizer(PropertyPath, (IComponentAsIdAttributesMapper m) => m.Access(accessor));
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void Access(System.Type accessorType)
{
CustomizersHolder.AddCustomizer(PropertyPath, (IComponentAsIdAttributesMapper m) => m.Access(accessorType));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Linq.Expressions;
using System.Reflection;
using NHibernate.Properties;

namespace NHibernate.Mapping.ByCode.Impl.CustomizersImpl
{
Expand Down Expand Up @@ -78,6 +79,11 @@ public void Access(Accessor accessor)
AddCustomizer(m => m.Access(accessor));
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void Access(System.Type accessorType)
{
AddCustomizer(m => m.Access(accessorType));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Linq.Expressions;
using System.Reflection;
using NHibernate.Properties;

namespace NHibernate.Mapping.ByCode.Impl.CustomizersImpl
{
Expand Down Expand Up @@ -112,6 +113,11 @@ public void Access(Accessor accessor)
_customizersHolder.AddCustomizer(typeof (TComponent), (IComponentAttributesMapper x) => x.Access(accessor));
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void Access(System.Type accessorType)
{
_customizersHolder.AddCustomizer(typeof (TComponent), (IComponentAttributesMapper x) => x.Access(accessorType));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using NHibernate.Properties;

namespace NHibernate.Mapping.ByCode.Impl.CustomizersImpl
{
Expand All @@ -25,6 +26,11 @@ public void Access(Accessor accessor)
CustomizersHolder.AddCustomizer(PropertyPath, (IDynamicComponentAttributesMapper m) => m.Access(accessor));
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void Access(System.Type accessorType)
{
CustomizersHolder.AddCustomizer(PropertyPath, (IDynamicComponentAttributesMapper m) => m.Access(accessorType));
Expand Down
6 changes: 6 additions & 0 deletions src/NHibernate/Mapping/ByCode/Impl/DynamicComponentMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq;
using System.Reflection;
using NHibernate.Cfg.MappingSchema;
using NHibernate.Properties;

namespace NHibernate.Mapping.ByCode.Impl
{
Expand Down Expand Up @@ -143,6 +144,11 @@ public void Access(Accessor accessor)
accessorPropertyMapper.Access(accessor);
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void Access(System.Type accessorType)
{
accessorPropertyMapper.Access(accessorType);
Expand Down
6 changes: 6 additions & 0 deletions src/NHibernate/Mapping/ByCode/Impl/IdBagMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Reflection;
using NHibernate.Cfg.MappingSchema;
using NHibernate.Persister.Collection;
using NHibernate.Properties;
using NHibernate.UserTypes;

namespace NHibernate.Mapping.ByCode.Impl
Expand Down Expand Up @@ -222,6 +223,11 @@ public void Access(Accessor accessor)
entityPropertyMapper.Access(accessor);
}

public void Access<T>() where T : IPropertyAccessor, new()
{
this.Access(typeof(T));
}

public void Access(System.Type accessorType)
{
entityPropertyMapper.Access(accessorType);
Expand Down
Loading