NHibernate遇到的问题集 持续更新。

问题1:

“NHibernate.TypeMismatchException”类型的异常在 NHibernate.dll 中发生,但未在用户代码中进行处理

其他信息: Provided id of the wrong type. Expected: System.Int64, got System.Int32

 

当查询方法id数据类型为long的时候,session.Get<HibernateModel.Warrant_BaseInfo>(1);直接在查询参数中数据数字。 则会报错。。。

 

解决办法。  提前声明long selectID = 1; session.Get<HibernateModel.Warrant_BaseInfo>(selectID);

你可能感兴趣的:(Hibernate)