title: NHIbernate SQLQuery and enum
body: <p>I'm trying to map an enum field to a dto property. I'm using PositionalToBeanResultTransformer, something like this: </p>
  
  <pre><code>PositionalToBeanResultTransformer trans = new PositionalToBeanResultTransformer(typeof(DTOClass), new string[] { "Id", "EnumProperty" });
  var data = Sesion.CreateSQLQuery("SELECT Id, EnumField FROM Table")
          .AddScalar("EnumField", NHibernateUtil.Custom(typeof(Enumerador)))
          .SetResultTransformer(trans)
          .List&lt;DTOClass&gt;();
  
  public class DTOClass
  {
      public int Id { get; set; }
      public Enumerador EnumProperty { get; set; }
  }
  </code></pre>
  
  <p>the DTOClass is not mapped so I can't use AddEntity() and the code with AddScalar() throws an error that I must implement NHibernate.UserTypes.IUserType.
  How can I convert the string field of the DB to an enum in a SQLQuery?</p>
  
  <p>Thanks in advance for the help.</p>