Page 1 of 1

Fluent NHibernate mapping for enum is inpropery generated

Posted: Fri 19 Apr 2013 07:19
by karel.kral
When using Enum with NHibernate fluent mapping, there is inproper mapping generated. Cannot be compiled wuth NHibernate 3.X.

If enum is primary key:

Code: Select all

  CompositeId()
     .KeyProperty(x => x.Section, set => {
      set.Type("ExportDefColumnSection"); // bad! Does not compile by NHibernate
should be:

Code: Select all

  CompositeId()
     .KeyProperty(x => x.Section, set => {
      set.Type(typeof(Anete.Common.Data.Nh.Entities.ExportDefColumnSection)); // ok
if enum is normal field:

Code: Select all

              
  Map(x => x.ReaderDeviceType)    
    .Column("typ")
    .CustomType("ReaderDeviceType")) // bad!
should be:

Code: Select all

              
  Map(x => x.ReaderDeviceType)    
    .Column("typ")
    .CustomType(typeof(Anete.Common.Data.Nh.Entities.ReaderDeviceType)) //ok

Re: Fluent NHibernate mapping for enum is inpropery generated

Posted: Tue 23 Apr 2013 11:03
by Shalex
Thank you for your report. We will post here when the issue is fixed.

Re: Fluent NHibernate mapping for enum is inpropery generated

Posted: Tue 30 Apr 2013 15:47
by Shalex
The bug is fixed. We will post here when the corresponding build of Entity Developer is available for download.