views:

114

answers:

1

I have the following mapping:

public class MyClassMap : ClassMap<MyClass>
{
    public MyClasseMap()
    {
        Table("TABLE_NAME");
        Id(x => x.Id).Column("TR_ID");
    }
}

When I try to retrieve all the entities using criteria objects I get the following:

System.FormatException : Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes) at NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList results) at NHibernate.Impl.CriteriaImpl.List(IList results) at NHibernate.Impl.CriteriaImpl.ListT

Tried all types of mapping variations. Still not working. Also using the latest binaries (#596) of fluent nhibernate. How do I get this to work?

A: 

The entity looks something like this:

 public class Entity
 {
   public Guid Id {get;set}
 }

The property is not virtual as I have disabled lazy-loading.

The database is sqlserver2008(enterprise edition 64bit) and the data type of the column is "uniqueidentifier". The OS I am using is Windows 7.

I also have other entities with Id's and Pk's as int's and they work perfectly.

unfluent
The same works for me using SQLEXPRESS 2008 on Windows7, but 32-bit
twk