Having never used nHibernate before it will probably take me a while to get a test added to the Envers source code, but I'm willing to give it a shot. I'll start working on it tonight. Would you be willing to accept a small custom test project?
Anyway, Envers very well may support it and I'm just doing something wrong. If anybody has an idea of what I might be screwing up (or where to start looking), I'd appreciate it. -Patrick On Wednesday, March 21, 2012 1:50:42 PM UTC-5, Roger wrote: > > Custom user types is suppose to work just fine with Envers. Can you send a > failing test (using hbm mapping) here please? > https://nhibernate.jira.com/browse/NHE > > > ________________________________ > Från: [email protected] [[email protected]] för Patrick > Skickat: den 21 mars 2012 19:28 > Till: [email protected] > Ämne: [nhusers] Envers with a PrimitiveType > > 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. > > -- 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/-/ASKN74a-YSYJ. 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.
