我正在使用此代码从数据库中检索对象。此代码返回一个对象,但该对象的类型只是Object
.
但是,我想返回 type Pcinitialdata
。如前所述,它只返回Object
,其类型为Object
我该如何解决这个问题?
String qryStrforCom = "select pci.fileNo,pci.projectNo,pci.fundId,pci.decrp,pci.devSec,pci.estBy,pci.areaCode,pci.targetDate,pci.jobnoRecedate,pci.conBy,pci.supBy,pci.ht33,pci.lt11,pci.sub11,pci.lt3Phase,pci.ltsPhase,pci.abc5w,pci.abc4w,pci.abcsecct,pci.perCapacity,pci.newCapacity,pci.proLtrToEsOn,pci.stdCost,pci.detailCost,pci.varianceNew from Pcinitialdata pci where TRIM(pci.estNo) = :value";
Query querycom = getEntityManager(webAppName).createQuery(qryStrforCom);
querycom.setParameter("value", value);
List<Pcinitialdata> listCom=querycom.getResultList();
if (listCom.isEmpty()) {
return null;
}
return listCom;