我有两个对象映射:
对于DataResource类:
Id(x => x.Id).UnsavedValue(0);
Map(x => x.Name).Length(45);
Map(x => x.Value).Not.LazyLoad().Length(100000000);
Map(x => x.Description).Length(200);
Map(x => x.CreatedDate);
对于Product类(映射很大 - 我已经减少了一点):
Id(x => x.Id).Nullable();
Map(x => x.CreatedDate);
HasMany(x => x.DataResources).Not.LazyLoad().Cascade.All();
当我做session.Query<DataResource>().ToList()
时 - 一切正常。但是,当我尝试拨打session.Query<Product>().ToList
时,我会收到以下信息:
Could not cast the value in field Passed58_5_ of type Byte[] to the Type
BooleanType. Please check to make sure that the mapping is correct and that your
DataProvider supports this Data Type.
内部异常w消息:
Unable to cast object of type 'System.Byte[]' to type 'System.IConvertible'.
DataResource.Value的类型为byte[]
。
这完全适用于MySQL和MsSQL。
有什么想法吗?