From: <fab...@us...> - 2011-04-20 21:46:19
|
Revision: 5729 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5729&view=rev Author: fabiomaulo Date: 2011-04-20 21:46:13 +0000 (Wed, 20 Apr 2011) Log Message: ----------- DynamicComponentMapper on the road Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/DynamicComponentMapper.cs Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/DynamicComponentMapper.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/DynamicComponentMapper.cs 2011-04-20 21:27:33 UTC (rev 5728) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/DynamicComponentMapper.cs 2011-04-20 21:46:13 UTC (rev 5729) @@ -5,20 +5,18 @@ namespace NHibernate.Mapping.ByCode.Impl { - public class DynamicComponentMapper : IDynamicComponentMapper + public class DynamicComponentMapper : AbstractPropertyContainerMapper, IDynamicComponentMapper { private readonly HbmDynamicComponent component; - private readonly HbmMapping mapDoc; private readonly IAccessorPropertyMapper accessorPropertyMapper; - public DynamicComponentMapper(HbmDynamicComponent component, MemberInfo declaringTypeMember, HbmMapping mapDoc) + public DynamicComponentMapper(HbmDynamicComponent component, MemberInfo declaringTypeMember, HbmMapping mapDoc) : base(declaringTypeMember.DeclaringType, mapDoc) { this.component = component; - this.mapDoc = mapDoc; accessorPropertyMapper = new AccessorPropertyMapper(declaringTypeMember.DeclaringType, declaringTypeMember.Name, x => component.access = x); } - private void AddProperty(object property) + protected override void AddProperty(object property) { if (property == null) { @@ -28,6 +26,11 @@ component.Items = component.Items == null ? toAdd : component.Items.Concat(toAdd).ToArray(); } + protected override bool IsMemberSupportedByMappedContainer(MemberInfo property) + { + return true; + } + public void Access(Accessor accessor) { accessorPropertyMapper.Access(accessor); @@ -52,62 +55,5 @@ { component.insert = consideredInInsertQuery; } - - public void Set(MemberInfo property, Action<ISetPropertiesMapper> collectionMapping, Action<ICollectionElementRelation> mapping) - { - throw new NotImplementedException(); - } - - public void Bag(MemberInfo property, Action<IBagPropertiesMapper> collectionMapping, Action<ICollectionElementRelation> mapping) - { - throw new NotImplementedException(); - } - - public void List(MemberInfo property, Action<IListPropertiesMapper> collectionMapping, Action<ICollectionElementRelation> mapping) - { - throw new NotImplementedException(); - } - - public void Map(MemberInfo property, Action<IMapPropertiesMapper> collectionMapping, Action<IMapKeyRelation> keyMapping, Action<ICollectionElementRelation> mapping) - { - throw new NotImplementedException(); - } - - public void IdBag(MemberInfo property, Action<IIdBagPropertiesMapper> collectionMapping, Action<ICollectionElementRelation> mapping) - { - throw new NotImplementedException(); - } - - public void Property(MemberInfo property, Action<IPropertyMapper> mapping) - { - var hbmProperty = new HbmProperty { name = property.Name }; - mapping(new PropertyMapper(property, hbmProperty)); - AddProperty(hbmProperty); - } - - public void Component(MemberInfo property, Action<IComponentMapper> mapping) - { - throw new NotImplementedException(); - } - - public void Component(MemberInfo property, Action<IDynamicComponentMapper> mapping) - { - throw new NotImplementedException(); - } - - public void ManyToOne(MemberInfo property, Action<IManyToOneMapper> mapping) - { - throw new NotImplementedException(); - } - - public void Any(MemberInfo property, System.Type idTypeOfMetaType, Action<IAnyMapper> mapping) - { - throw new NotImplementedException(); - } - - public void OneToOne(MemberInfo property, Action<IOneToOneMapper> mapping) - { - throw new NotImplementedException(); - } } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |