我试图在JPA 2.1中进行左连接,但是我收到错误:
SELECT DISTINCT new detail("+
"TMB1004.numPosPiaReg, TMB1004.impRic,"+
"TMB1006.prgPgt, TMB1006.prgPia, TMB1006.codCup, TMB1006.desTitPgt, TMB1006.impFinMinEse, TMB1006.impFinMinRim, TMB1006.impCofEntEse,"+
"MFG1012.desReg, MFG1029.desPrv,"+
"TEL1002.desEnt, TEL1002.codComEnt, TEL1002.codFisEnt,"+
"TEL1003.codNaz, TEL1003.codCinEur, TEL1003.codCinCnt, TEL1003.codAbi, TEL1003.codCab, TEL1003.codCnt, TEL1003.codTes, TEL1003.codCntTes,"+
"TEL1004.numTelCtt, TEL1004.desIndEma,"+
"TEL1005.desNomRef, TEL1005.desCogRef) "+
"FROM Tmb1004Piano TMB1004, Tmb1008Assoc TMB1008, Tmb1006Prog TMB1006 LEFT JOIN TEL1003 ON TMB1006.tel1003Ana.prgAnaCnb = TEL1003.prgAnaCnb, "+
"Tel1002Ana TEL1002, Tel1003Ana TEL1003, Tel1004Ana TEL1004, Tel1005Ana TEL1005, "+
"Mfg1012Regione MFG1012,"+
"Mfg1029Provnuoist MFG1029 "+
"WHERE TMB1006.tel1002Ana.codAnaEnt = TEL1002.codAnaEnt "+
"AND TMB1006.prgPgt = TMB1008.tmb1006Prog.prgPgt "+
"AND TMB1008.tmb1004Piano.prgPiaBei = TMB1004.prgPiaBei "+
"AND TEL1005.prgAnaRef = TMB1006.tel1005Ana.prgAnaRef "+
"AND TEL1004.prgAnaCtt = TMB1006.tel1004Ana.prgAnaCtt "+
"AND MFG1012.codReg = TMB1004.codReg "+
"AND MFG1029.codPrv = TMB1004.codPrv "+
"AND TMB1006.tmb1003Tipo.id.prgTipSta != 1
我得到的错误是:
引起:java.lang.IllegalArgumentException:org.hibernate.hql.internal.ast.QuerySyntaxException:意外令牌:ON第1行,第782行[SELECT DISTINCT新细节(TMB1004.numPosPiaReg,TMB1004.impRic,TMB1006。 prgPgt,TMB1006.prgPia,TMB1006.codCup,TMB1006.desTitPgt,TMB1006.impFinMinEse,TMB1006.impFinMinRim,TMB1006.impCofEntEse,MFG1012.desReg,MFG1029.desPrv,TEL1002.desEnt,TEL1002.codComEnt,TEL1002.codFisEnt,TEL1003.codNaz, TEL1003.codCinEur,TEL1003.codCinCnt,TEL1003.codAbi,TEL1003.codCab,TEL1003.codCnt,TEL1003.codTes,TEL1003.codCntTes,TEL1004.numTelCtt,TEL1004.desIndEma,TEL1005.desNomRef,TEL1005.desCogRef)FROM Tmb1004Piano TMB1004,Tmb1008Assoc TMB1008 ,Tmb1006Prog TMB1006 LEFT JOIN TEL1003 ON TMB1006.tel1003Ana.prgAnaCnb = TEL1003.prgAnaCnb,Tel1002Ana TEL1002,Tel1003Ana TEL1003,Tel1004Ana TEL1004,Tel1005Ana TEL1005,Mfg1012Re MFG1012,Mfg1029Pr MFG1029 WHERE TMB1006.tel1002Ana.codAnaEnt = TEL1002.codAnaEnt AND TMB1006.prgPgt = TMB1008 .tmb1006Prog.prgPgt A. ND TMB1008.tmb1004Piano.prgPiaBei = TMB1004.prgPiaBei AND TEL1005.prgAnaRef = TMB1006.tel1005Ana.prgAnaRef AND TEL1004.prgAnaCtt = TMB1006.tel1004Ana.prgAnaCtt AND MFG1012.codReg = TMB1004.codReg AND MFG1029.codPrv = TMB1004.codPrv AND TMB1006.tmb1003Tipo .id.prgTipSta!= 1]
为什么?