From: <fab...@us...> - 2011-04-26 17:18:06
|
Revision: 5766 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5766&view=rev Author: fabiomaulo Date: 2011-04-26 17:17:59 +0000 (Tue, 26 Apr 2011) Log Message: ----------- preparing the painful note (composite-id) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/IPlainPropertyContainerMapper.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/ICompositeIdMapper.cs Added: trunk/nhibernate/src/NHibernate/Mapping/ByCode/ICompositeIdMapper.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/ICompositeIdMapper.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/ICompositeIdMapper.cs 2011-04-26 17:17:59 UTC (rev 5766) @@ -0,0 +1,28 @@ +namespace NHibernate.Mapping.ByCode +{ + public interface ICompositeIdAttributesMapper {} + + public interface ICompositeIdMapper : ICompositeIdAttributesMapper, IMinimalPlainPropertyContainerMapper {} + + public interface IComponentAsIdAttributesMapper : IAccessorPropertyMapper + { + /// <summary> + /// Force the component to a different type than the one of the property. + /// </summary> + /// <param name="componentType">Mapped component type.</param> + /// <remarks> + /// Useful when the property is an interface and you need the mapping to a concrete class mapped as component. + /// </remarks> + void Class(System.Type componentType); + } + + public interface IComponentAsIdMapper : IComponentAsIdAttributesMapper, IMinimalPlainPropertyContainerMapper { } + + public interface IComponentAsIdAttributesMapper<TComponent> : IAccessorPropertyMapper + { + void Class<TConcrete>() where TConcrete : TComponent; + } + + public interface IComponentAsIdMapper<TComponent> : IComponentAsIdAttributesMapper<TComponent>, IMinimalPlainPropertyContainerMapper<TComponent> where TComponent : class { } + +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/IPlainPropertyContainerMapper.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/IPlainPropertyContainerMapper.cs 2011-04-26 13:58:16 UTC (rev 5765) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/IPlainPropertyContainerMapper.cs 2011-04-26 17:17:59 UTC (rev 5766) @@ -5,14 +5,17 @@ namespace NHibernate.Mapping.ByCode { - public interface IBasePlainPropertyContainerMapper + public interface IMinimalPlainPropertyContainerMapper { void Property(MemberInfo property, Action<IPropertyMapper> mapping); + void ManyToOne(MemberInfo property, Action<IManyToOneMapper> mapping); + } + public interface IBasePlainPropertyContainerMapper : IMinimalPlainPropertyContainerMapper + { void Component(MemberInfo property, Action<IComponentMapper> mapping); void Component(MemberInfo property, Action<IDynamicComponentMapper> mapping); - void ManyToOne(MemberInfo property, Action<IManyToOneMapper> mapping); void Any(MemberInfo property, System.Type idTypeOfMetaType, Action<IAnyMapper> mapping); } @@ -21,12 +24,18 @@ void OneToOne(MemberInfo property, Action<IOneToOneMapper> mapping); } - public interface IBasePlainPropertyContainerMapper<TContainer> + public interface IMinimalPlainPropertyContainerMapper<TContainer> { void Property<TProperty>(Expression<Func<TContainer, TProperty>> property); void Property<TProperty>(Expression<Func<TContainer, TProperty>> property, Action<IPropertyMapper> mapping); void Property(FieldInfo member, Action<IPropertyMapper> mapping); + void ManyToOne<TProperty>(Expression<Func<TContainer, TProperty>> property, Action<IManyToOneMapper> mapping) where TProperty : class; + void ManyToOne<TProperty>(Expression<Func<TContainer, TProperty>> property) where TProperty : class; + } + + public interface IBasePlainPropertyContainerMapper<TContainer> : IMinimalPlainPropertyContainerMapper<TContainer> + { void Component<TComponent>(Expression<Func<TContainer, TComponent>> property, Action<IComponentMapper<TComponent>> mapping) where TComponent : class; void Component<TComponent>(Expression<Func<TContainer, TComponent>> property) where TComponent : class; @@ -35,9 +44,6 @@ TComponent dynamicComponentTemplate, Action<IDynamicComponentMapper<TComponent>> mapping) where TComponent : class; - void ManyToOne<TProperty>(Expression<Func<TContainer, TProperty>> property, Action<IManyToOneMapper> mapping) where TProperty : class; - void ManyToOne<TProperty>(Expression<Func<TContainer, TProperty>> property) where TProperty : class; - void Any<TProperty>(Expression<Func<TContainer, TProperty>> property, System.Type idTypeOfMetaType, Action<IAnyMapper> mapping) where TProperty : class; } Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2011-04-26 13:58:16 UTC (rev 5765) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2011-04-26 17:17:59 UTC (rev 5766) @@ -295,6 +295,7 @@ <Compile Include="Mapping\ByCode\Conformist\JoinedSubclassMapping.cs" /> <Compile Include="Mapping\ByCode\Conformist\SubclassMapping.cs" /> <Compile Include="Mapping\ByCode\Conformist\UnionSubclassMapping.cs" /> + <Compile Include="Mapping\ByCode\ICompositeIdMapper.cs" /> <Compile Include="Mapping\ByCode\IDynamicComponentAttributesMapper.cs" /> <Compile Include="Mapping\ByCode\Impl\CustomizersImpl\DynamicComponentCustomizer.cs" /> <Compile Include="Mapping\ByCode\Impl\DynamicComponentMapper.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |