hql select new 自定义对象时报空指针错误
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()的时候就报空指针错误,到底这是那里出错了,高手指教
...全文


基础和管理
