Hi,
I have problem when mapping a Version column:
The exception is this:
NHibernate.MappingException: Duplicate property mapping of Version
found in Domain.Model.File
public class Entity: IEntity<Guid>
{
public virtual Guid Id { get; set; }
public virtual int Version { get; set; }
}
public class File: Entity
{
...
}
the mapping is used from:
http://fabiomaulo.blogspot.com/2011/04/nhibernate-32-mapping-by-code_13.html?showComment=1302786118707#c8361921102707139162
var mapper = new ConventionModelMapper();
var baseEntityType = typeof(Entity);
mapper.IsEntity((t, declared) => baseEntityType.IsAssignableFrom(t) &&
baseEntityType != t && !t.IsInterface);
mapper.IsRootEntity((t, declared) =>
baseEntityType.Equals(t.BaseType));
mapper.Class<Entity>(map =>
{
map.Id(x => x.Id, m => m.Generator(Generators.GuidComb));
map.Version(x => x.Version, m =>
m.Generated(VersionGeneration.Always));
});
Class File does not have its Version, it inherits it from entity. Also
there are no mapping files in project, all it is mapped by convention,
like in the upper blog.
Why I am getting this exception?
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.