报错:No row with the given identifier exists:13,of class:NHibernateWebDemo.Model.Supply 源代码:public static IList GetProductBystorstates_AllCount(int state,int audit,string keyword){string hql = "select p from Product_Sup p join p.ProductTy

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/14 16:25:47
报错:No row with the given identifier exists:13,of class:NHibernateWebDemo.Model.Supply 源代码:public static IList GetProductBystorstates_AllCount(int state,int audit,string keyword){string hql =

报错:No row with the given identifier exists:13,of class:NHibernateWebDemo.Model.Supply 源代码:public static IList GetProductBystorstates_AllCount(int state,int audit,string keyword){string hql = "select p from Product_Sup p join p.ProductTy
报错:No row with the given identifier exists:13,of class:NHibernateWebDemo.Model.Supply
源代码:
public static IList GetProductBystorstates_AllCount(int state,int audit,string keyword)
{
string hql = "select p from Product_Sup p join p.ProductType_Sup pt where p.ProductState= " + state + "and p.IsAuditing=" + audit + "and p.ProductName like '%" + keyword + "%' or pt.ProductTypeName like'%" + keyword + "%'or p.Effect like'%" + keyword + "%'" + "or p.ProductName='" + keyword + "'or p.Effect='" + keyword + "'or pt.ProductTypeName='" + keyword + "'";
return session.CreateQuery(hql).List();
}

报错:No row with the given identifier exists:13,of class:NHibernateWebDemo.Model.Supply 源代码:public static IList GetProductBystorstates_AllCount(int state,int audit,string keyword){string hql = "select p from Product_Sup p join p.ProductTy
根据PK值找数据库记录没有找到,没有办法转换成对象.请查看外键之类的数据映射.

说你的字段名错误,你看一下有没有误写