今天客户方服务器上突然有一个功能保存了,查看日志信息后发现,错误信息:
Could not instantiate class XXX from tuple at AliasToBeanConstructorResultTransformer...
Google了很久才发现有可能是HQL语句中别名的问题,具体原因未知,现在处理办法是,将下面的语句中的别名去掉:
StringBuffer hql = new StringBuffer("select new ContractItem(l, "
+ " pi.unitPrice, " + " pi.currencyType, " + "pi.currencyTypeDisplay," + " pi.units, "
+ " sum(pi.quantity + pi.adjQuantity), " + " pp, " + " pi.task) "
+ " from PurchasePlanItem pi " + " join pi.purchasePlan pp"
+ " join pi.priorList l " + " where l.supplierNo = ? "
+ " and pp.id in (");
具体是否可以解决,还要看一会儿的部署情况。