I am getting an error when i use specific enum in a where clause.  For
some reason nhibernate is setting up the parameter as an int rather
then string.
The status class:
public class StatusDate
{
public virtual StatusType? MyStatusType {get;set;}
public virtual DateTime?    Date{get;set;}
}

The StatusDate MyStatusType property mapping:

    <property name="CalyxStatusType"
type="FluentNHibernate.Mapping.GenericEnumMapper`1[[Calyx.Common.Models.Origination.Entities.StatusType,
Calyx.Common.Models.Origination, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=0ca8877e5830dba7]], FluentNHibernate,
Version=1.1.0.692, Culture=neutral, PublicKeyToken=8aa435e3cb308880"
lazy="false">
      <column name="CalyxStatusType" />
    </property>


when i do a LINQ query

var testit =  from statDate in _Session.Query<StatusDates>()
                          where statDate.MyStatusType ==
StatusType.EstimatedClose
                          select statDate;
testit.ToList();

I am receiving this error message:

could not execute query
[ select statusdate0_.MyStatusType as col_0_0_ from [StatusDates]
statusdate0_ where ((statusdate0_.MyStatusType is null) and (@p0 is
not null) or (statusdate0_.MyStatusType is not null) and (@p0 is null)
or statusdate0_.MyStatusType<>@p0) and ((statusdate0_.MyStatusType is
null) and (@p1 is null) or statusdate0_.mystatusty...@p1) ]
  Name:p1 - Value:null  Name:p2 - Value:12
[SQL: select statusdate0_.MyStatusType as col_0_0_ from [StatusDates]
statusdate0_ where ((statusdate0_.MyStatusType is null) and (@p0 is
not null) or (statusdate0_.MyStatusType is not null) and (@p0 is null)
or statusdate0_.MyStatusType<>@p0) and ((statusdate0_.MyStatusType is
null) and (@p1 is null) or statusdate0_.mystatusty...@p1)]

NHibernate.Exceptions.GenericADOException

Any thoughts as to what could be causing this?

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
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