Hi Neal,

I just found the same problem... Version seems to only wotk when
declared in the Entity class and does not when declared in the Base
Class.

By the way, would you be so kind as to post your Mapping override
code, its been a long day... :)

Thanks,
Chanan.

On Oct 18, 7:30 pm, Neal Blomfield <neal.blomfi...@gmail.com> wrote:
> I have an entity base class that looks as follows:
>
>     public abstract class Entity : IEquatable<Entity>
>     {
>         public Guid Id { get; private set; }
>         public longVersion{ get; protected set; }
>
>         protected Entity()
>         {
>             Id = GenerateComb();
>         }
>
>         public override string ToString()
>         {
>             // ... elided for brevity
>         }
>
>         public override bool Equals( object obj )
>         {
>             return Equals( obj as Entity );
>         }
>
>         public bool Equals( Entity other )
>         {
>             if (other == null)
>             {
>                 return false;
>             }
>
>             if (ReferenceEquals(other, this))
>             {
>                 return true;
>             }
>
>             if (GetType() != other.GetType())
>             {
>                 return false;
>             }
>
>             return InternalEquals(other);
>         }
>
>         protected virtual bool InternalEquals( Entity other )
>         {
>             // ... elided for brevity
>         }
>
>         public override int GetHashCode()
>         {
>             // ... elided for brevity
>         }
>
>         protected virtual object[] GetSignaturePropertyValues()
>         {
>             return new object[]{Id,Version};
>         }
>
>         private Guid GenerateComb()
>         {
>             // ... elided for brevity ( but its based on the NH /
> Jimmy Nilsson implementation )
>         }
>     }
>
>     public abstract class Entity<T> : Entity, IEquatable<T> where T :
> Entity<T>
>     {
>         public virtual bool Equals( T other )
>         {
>             return base.Equals( other );
>         }
>     }
>
> All entities inherit from Entity<T>.
>
> This is automapped via:
>
> AutoMap
> .AssemblyOf<Entity>()
> .Where( type => typeof( Entity ).IsAssignableFrom( type ) )
> .IgnoreBase<Entity>()
> .IgnoreBase( typeof( Entity<> ) );
>
> With this setup, theVersionproperty in the Entity base class is not
> being mapped ( noVersioncolumn is being created at all ).  I have
> checked that FNH can see the property by changing it to VersionX and
> checking it was mapped ( which it was ), I have also ( while
> Entity.Versionwas renamed Entity.VersionX ) added aVersionproperty
> to one of my entities directly ( i.e. I had a property declared as
> Account.Version) and this worked as expected.
>
> Any ideas why Entity.Versionis not being mapped as I am at a complete
> loss as to why this is happening ( currently I must explicitly map it
> with an automapping override ) =(
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to