I'm trying to get Envers up and running in my project (based on S#arp Lite) 
and am having trouble getting it to work with a custom PrimitiveType.  
Basically, I using the Enumeration class from Jimmy Bogard's site:
http://lostechies.com/jimmybogard/2008/08/12/enumeration-classes/

and tying it into nHibernate with an EnumerationType<T> that inherits from 
PrimitiveType.  That code is mostly stolen from:
http://code.google.com/p/codecampserver/source/browse/trunk/src/Infrastructure.NHibernate/DataAccess/EnumerationType.cs?r=1063

My nHibernate mapping for a simple property like this is:
    map.Property(x => x.Type,
        pm =>
        {
            pm.Type<EnumerationType<CourseType>>();
            pm.Column("CourseTypeFk");
        });

However, Envers doesn't seem to be able to deal with it.  I just want it to 
treat it as its associated primitive type (int) but I'm getting the 
following exception:

NHibernate.MappingException was unhandled by user code
  Message=Could not determine type for: Enumeration, NHibernate.Envers, for 
columns: NHibernate.Mapping.Column(CourseTypeFk)
  Source=NHibernate
  StackTrace:
       at NHibernate.Mapping.SimpleValue.get_Type()
       at NHibernate.Mapping.SimpleValue.IsValid(IMapping mapping)
       at NHibernate.Mapping.Property.IsValid(IMapping mapping)
       at NHibernate.Mapping.PersistentClass.Validate(IMapping mapping)
       at NHibernate.Mapping.RootClass.Validate(IMapping mapping)
       at NHibernate.Cfg.Configuration.ValidateEntities()
       at NHibernate.Cfg.Configuration.Validate()
       at NHibernate.Cfg.Configuration.BuildSessionFactory()
       at 
ProcessSystem.Init.DependencyResolverInitializer.<Initialize>b__1()
       at 
StructureMap.Pipeline.LambdaInstance`1.<>c__DisplayClass8.<.ctor>b__6(IContext 
s)
       at StructureMap.Pipeline.LambdaInstance`1.build(Type pluginType, 
BuildSession session)
  InnerException: 

Any help would be greatly appreciated.

Thanks,
Patrick

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/Pw0Nkff7kL0J.
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.

Reply via email to