问题描述
/////////////////////////////报错信息Hibernate:selectfxcustomer0_.CLIENTIDasCLIENTID74_,fxcustomer0_.CLIENTNUMasCLIENTNUM74_,fxcustomer0_.CLIENTNAMEasCLIENTNAME74_,fxcustomer0_.CLIENTTYPEasCLIENTTYPE74_,fxcustomer0_.CLIENTKINDasCLIENTKIND74_,fxcustomer0_.TAX_NUMasTAX6_74_,fxcustomer0_.OLD_NUMasOLD7_74_,fxcustomer0_.ACCOUNT_CODEasACCOUNT8_74_,fxcustomer0_.SHORTNAMEasSHORTNAME74_,fxcustomer0_.PINYINasPINYIN74_,fxcustomer0_.CONTACTNAMEasCONTACT11_74_,fxcustomer0_.TELPHONEasTELPHONE74_,fxcustomer0_.PHONEasPHONE74_,fxcustomer0_.AREAIDasAREAID74_,fxcustomer0_.REGIONIDasREGIONID74_,fxcustomer0_.CITYIDasCITYID74_,fxcustomer0_.ADDRESSasADDRESS74_,fxcustomer0_.ZIPCODEasZIPCODE74_,fxcustomer0_.FAXasFAX74_,fxcustomer0_.EMAILasEMAIL74_,fxcustomer0_.BANKasBANK74_,fxcustomer0_.BACKACCOUNTasBACKACC22_74_,fxcustomer0_.ACCOUNTNAMEasACCOUNT23_74_,fxcustomer0_.ACCOUNTADDasACCOUNTADD74_,fxcustomer0_.ACCOUNTTELasACCOUNTTEL74_,fxcustomer0_.DISCOUNTasDISCOUNT74_,fxcustomer0_.DELIVERYADDasDELIVER27_74_,fxcustomer0_.STOREPHONEasSTOREPHONE74_,fxcustomer0_.RAILWAYasRAILWAY74_,fxcustomer0_.CLIENTCLASSasCLIENTC30_74_,fxcustomer0_.CLIENTNATUREasCLIENTN31_74_,fxcustomer0_.SELLMODEasSELLMODE74_,fxcustomer0_.REMARKasREMARK74_,fxcustomer0_.OPERATORasOPERATOR74_,fxcustomer0_.MODIFYTIMEasMODIFYTIME74_,fxcustomer0_.NODEIDasNODEID74_,fxcustomer0_.DELTFasDELTF74_,fxcustomer0_.STATEasSTATE74_,fxcustomer0_.WHOLESALERasWHOLESALER74_,fxcustomer0_.RETURNasRETURN74_,fxcustomer0_.MODELasMODEL74_fromPMS.FX_CLIENTINFOfxcustomer0_where(fxcustomer0_.DELTF<>1orfxcustomer0_.DELTFisnull)andfxcustomer0_.ACCOUNT_CODE='4263'18090016WARN[http-8080-Processor19]org.hibernate.util.JDBCExceptionReporter-SQLError:17059,SQLState:null18090016ERROR[http-8080-Processor19]org.hibernate.util.JDBCExceptionReporter-无法转换为内部表示18090016ERROR[http-8080-Processor19]cn.rmsd.pms.hibernate.dao.BaseDao/////////////////////////////////////java代码///////////////////////////////Stringhql="fromFxCustomerInfocwhere(c.deltf<>1orc.deltfisnull)andc.accountCode='"+ywy+"'";intkeynum=1;Listlist=dao.list(hql);====>/////报错的行StringBufferjson=newStringBuffer();json.append("{root:[");for(Iteratorit=list.iterator();it.hasNext();){FxCustomerInfoc=(FxCustomerInfo)it.next();////////////////////////////////////////////////////////////////////////////////======dao层代码publicListlist(Stringhql){Listlist=null;try{session=HibernateSessionFactory.getSession();tx=session.beginTransaction();list=session.createQuery(hql).list();tx.commit();}catch(HibernateExceptione){log.error(e);e.printStackTrace();tx.rollback();}finally{session.close();}returnlist;}注:在查询有数据结果时不会报错,但是在没有符合条的数据时会抛出这个异常还请各位路过的大侠们多多指教谢谢。。。
解决方案
解决方案二:
一样的问题啊!