Fluent NHibernate mapping for enum is inpropery generated

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
karel.kral
Posts: 7
Joined: Tue 02 Oct 2012 15:00

Fluent NHibernate mapping for enum is inpropery generated

Post by karel.kral » Fri 19 Apr 2013 07:19

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

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: Fluent NHibernate mapping for enum is inpropery generated

Post by Shalex » Tue 23 Apr 2013 11:03

Thank you for your report. We will post here when the issue is fixed.

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: Fluent NHibernate mapping for enum is inpropery generated

Post by Shalex » Tue 30 Apr 2013 15:47

The bug is fixed. We will post here when the corresponding build of Entity Developer is available for download.

Post Reply