hql select new 自定义对象时报空指针错误

ldhscxl ldhscxl 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

String hql = "select new fi.salesManagement.bean.PurchaseVo(f.inId as Id,f.ifoId as ifoId,i.UTime as time,f.ACurnum as count,f.inPrice as inprice) from PurchaseInStorageInfo f inner join PurchaseInStorage i with f.inId = i.inId and f.delFlag = 0 and i.delFlag = 0 and f.AId = ? and f.sId = ?";
String hql = "select new fi.salesManagement.bean.PurchaseVo(f.inId as Id,f.ifoId as ifoId,i.UTime as time,f.ACurnum as count,f.inPrice as inprice) from PurchaseInStorageInfo f, PurchaseInStorage i where f.inId = i.inId";
List<PurchaseVo> PurchaseVoList = this.createQuery(getSession(), hql, values).list();


PurchaseVo定义和构造方法如下:

private Long inId;
private Long ifoId;
private Date UTime;
private Long ACurnum;
private BigDecimal inPrice;

public PurchaseVo(Long inId, Long ifoId, Date uTime, Long aCurnum,
BigDecimal inPrice) {
super();
this.inId = inId;
this.ifoId = ifoId;
UTime = uTime;
ACurnum = aCurnum;
this.inPrice = inPrice;
}




但是当我执行this.createQuery(getSession(), hql, values).list()的时候就报空指针错误,到底这是那里出错了,高手指教
...全文
评论 5
收藏 已收藏
分享
返回顶部
ldhscxl
基础和管理 17,379 成员 95,111 内容