Hibernate version: hibernate-3.1
Please i don't understand why hibernate throw me that "order by mo2_.da30ma asc" column don't exists? But i think that the sql that hibernate generate it's correct.
Please help me
Devis
Code:
Criteria crit = session.createCriteria(CFatteVO.class, "vo")
.add(Restrictions.eq("pk.SOFAFT", new Integer(SOFAFT)))
.add(Restrictions.eq("pk.AAFAFT", new Integer(AAFAFT)))
.add(Restrictions.eq("pk.SFATFT", new String(SFATFT)))
.add(Restrictions.eq("pk.NFATFT", new Double(NFATFT)))
.createCriteria("righe","r")
.createCriteria("r.materiale","mo").addOrder(Order.asc("mo.da30ma"))
.setCacheable(true);
Code:
Hibernate: select this_.SOFAFT as SOFAFT3_, this_.AAFAFT as AAFAFT3_, this_.SFATFT as SFATFT3_, this_.NFATFT as NFATFT3_, this_.STREFT as STREFT12_3_, this_.NRAZFT as NRAZFT12_3_, this_.DTUMFT as DTUMFT12_3_, this_.ORUMFT as ORUMFT12_3_, this_.BLREFT as BLREFT12_3_, this_.UTENFT as UTENFT12_3_, this_.GGFAFT as GGFAFT12_3_, this_.MMFAFT as MMFAFT12_3_, this_.TDOCFT as TDOCFT12_3_, this_.SFAPFT as SFAPFT12_3_, this_.NFAPFT as NFAPFT12_3_, this_.OFAPFT as OFAPFT12_3_, this_.AFAPFT as AFAPFT12_3_, this_.CVENFT as CVENFT12_3_, this_.CDFAFT as CDFAFT12_3_, this_.CDRIFT as CDRIFT12_3_, this_.NAZIFT as NAZIFT12_3_, this_.ZONAFT as ZONAFT12_3_, this_.CLINFT as CLINFT12_3_, this_.CSP1FT as CSP24_12_3_, this_.CSP2FT as CSP25_12_3_, this_.MPAGFT as MPAGFT12_3_, this_.GGDPFT as GGDPFT12_3_, this_.MMDPFT as MMDPFT12_3_, this_.AADPFT as AADPFT12_3_, this_.SODPFT as SODPFT12_3_, this_.CVALFT as CVALFT12_3_, this_.CLISFT as CLISFT12_3_, this_.CAMBFT as CAMBFT12_3_, this_.QFAMFT as QFAMFT12_3_, this_.QFAPFT as QFAPFT12_3_, this_.SMT1FT as SMT36_12_3_, this_.SMT2FT as SMT37_12_3_, this_.SMT3FT as SMT38_12_3_, this_.IMLOFT as IMLOFT12_3_, this_.ISMRFT as ISMRFT12_3_, this_.ISMTFT as ISMTFT12_3_, this_.ISCAFT as ISCAFT12_3_, this_.ISP1FT as ISP43_12_3_, this_.ISP2FT as ISP44_12_3_, this_.IIVAFT as IIVAFT12_3_, this_.IMVAFT as IMVAFT12_3_, this_.IBOFFT as IBOFFT12_3_, this_.IBORFT as IBORFT12_3_, this_.IBOTFT as IBOTFT12_3_, this_.ISPIFT as ISPIFT12_3_, this_.IFATFT as IFATFT12_3_, this_.PNETFT as PNETFT12_3_, this_.PLORFT as PLORFT12_3_, this_.NRCOFT as NRCOFT12_3_, this_.FSFAFT as FSFAFT12_3_, this_.FDFAFT as FDFAFT12_3_, this_.FTFAFT as FTFAFT12_3_, this_.FARCFT as FARCFT12_3_, this_.FLA1FT as FLA59_12_3_, this_.FLA2FT as FLA60_12_3_, this_.FLA3FT as FLA61_12_3_, this_.FLA4FT as FLA62_12_3_, this_.FLA5FT as FLA63_12_3_, this_.FLA6FT as FLA64_12_3_, this_.FLA7FT as FLA65_12_3_, this_.FLA8FT as FLA66_12_3_, this_.FL10FT as FL67_12_3_, this_.FL20FT as FL68_12_3_, this_.FL30FT as FL69_12_3_, r1_.SOFAFR as SOFAFR0_, r1_.AAFAFR as AAFAFR0_, r1_.SFATFR as SFATFR0_, r1_.NFATFR as NFATFR0_, r1_.NRFAFR as NRFAFR0_, r1_.STREFR as STREFR11_0_, r1_.NRAZFR as NRAZFR11_0_, r1_.DTUMFR as DTUMFR11_0_, r1_.ORUMFR as ORUMFR11_0_, r1_.BLREFR as BLREFR11_0_, r1_.GGFAFR as GGFAFR11_0_, r1_.MMFAFR as MMFAFR11_0_, r1_.SFAPFR as SFAPFR11_0_, r1_.NFAPFR as NFAPFR11_0_, r1_.OFAPFR as OFAPFR11_0_, r1_.AFAPFR as AFAPFR11_0_, r1_.NRFPFR as NRFPFR11_0_, r1_.CDFAFR as CDFAFR11_0_, r1_.NAZIFR as NAZIFR11_0_, r1_.ZONAFR as ZONAFR11_0_, r1_.STAGFR as STAGFR11_0_, r1_.NUORFR as NUORFR11_0_, r1_.NURIFR as NURIFR11_0_, r1_.NUSRFR as NUSRFR11_0_, r1_.AGE1FR as AGE25_11_0_, r1_.PRV1FR as PRV26_11_0_, r1_.AGE2FR as AGE27_11_0_, r1_.PRV2FR as PRV28_11_0_, r1_.FPRVFR as FPRVFR11_0_, r1_.MARCFR as MARCFR11_0_, r1_.LINEFR as LINEFR11_0_, r1_.SLINFR as SLINFR11_0_, r1_.MODEFR as MODEFR11_0_, r1_.CLMAFR as CLMAFR11_0_, r1_.MATEFR as MATEFR11_0_, r1_.COLOFR as COLOFR11_0_, r1_.VARIFR as VARIFR11_0_, r1_.MISUFR as MISUFR11_0_, r1_.CCARFR as CCARFR11_0_, r1_.CETIFR as CETIFR11_0_, r1_.DROPFR as DROPFR11_0_, r1_.CDTGFR as CDTGFR11_0_, r1_.DE60FR as DE43_11_0_, r1_.UMAVFR as UMAVFR11_0_, r1_.QFAMFR as QFAMFR11_0_, r1_.PRVMFR as PRVMFR11_0_, r1_.QT01FR as QT47_11_0_, r1_.QT02FR as QT48_11_0_, r1_.QT03FR as QT49_11_0_, r1_.QT04FR as QT50_11_0_, r1_.QT05FR as QT51_11_0_, r1_.QT06FR as QT52_11_0_, r1_.QT07FR as QT53_11_0_, r1_.QT08FR as QT54_11_0_, r1_.QT09FR as QT55_11_0_, r1_.QT10FR as QT56_11_0_, r1_.QT11FR as QT57_11_0_, r1_.QT12FR as QT58_11_0_, r1_.QT13FR as QT59_11_0_, r1_.QT14FR as QT60_11_0_, r1_.QT15FR as QT61_11_0_, r1_.QT16FR as QT62_11_0_, r1_.QT17FR as QT63_11_0_, r1_.QT18FR as QT64_11_0_, r1_.QT19FR as QT65_11_0_, r1_.QT20FR as QT66_11_0_, r1_.QT21FR as QT67_11_0_, r1_.QT22FR as QT68_11_0_, r1_.QT23FR as QT69_11_0_, r1_.QT24FR as QT70_11_0_, r1_.QT25FR as QT71_11_0_, r1_.QT26FR as QT72_11_0_, r1_.QT27FR as QT73_11_0_, r1_.QT28FR as QT74_11_0_, r1_.QT29FR as QT75_11_0_, r1_.QT30FR as QT76_11_0_, r1_.QT31FR as QT77_11_0_, r1_.QT32FR as QT78_11_0_, r1_.QT33FR as QT79_11_0_, r1_.QT34FR as QT80_11_0_, r1_.QFAPFR as QFAPFR11_0_, r1_.PV01FR as PV82_11_0_, r1_.PV02FR as PV83_11_0_, r1_.PV03FR as PV84_11_0_, r1_.PV04FR as PV85_11_0_, r1_.PV05FR as PV86_11_0_, r1_.PV06FR as PV87_11_0_, r1_.PV07FR as PV88_11_0_, r1_.PV08FR as PV89_11_0_, r1_.PV09FR as PV90_11_0_, r1_.PV10FR as PV91_11_0_, r1_.PV11FR as PV92_11_0_, r1_.PV12FR as PV93_11_0_, r1_.PV13FR as PV94_11_0_, r1_.PV14FR as PV95_11_0_, r1_.PV15FR as PV96_11_0_, r1_.PV16FR as PV97_11_0_, r1_.PV17FR as PV98_11_0_, r1_.PV18FR as PV99_11_0_, r1_.PV19FR as PV100_11_0_, r1_.PV20FR as PV101_11_0_, r1_.PV21FR as PV102_11_0_, r1_.PV22FR as PV103_11_0_, r1_.PV23FR as PV104_11_0_, r1_.PV24FR as PV105_11_0_, r1_.PV25FR as PV106_11_0_, r1_.PV26FR as PV107_11_0_, r1_.PV27FR as PV108_11_0_, r1_.PV28FR as PV109_11_0_, r1_.PV29FR as PV110_11_0_, r1_.PV30FR as PV111_11_0_, r1_.PV31FR as PV112_11_0_, r1_.PV32FR as PV113_11_0_, r1_.PV33FR as PV114_11_0_, r1_.PV34FR as PV115_11_0_, r1_.FPRMFR as FPRMFR11_0_, r1_.SCMPFR as SCMPFR11_0_, r1_.SMR1FR as SMR118_11_0_, r1_.SMR2FR as SMR119_11_0_, r1_.SMR3FR as SMR120_11_0_, r1_.FSCOFR as FSCOFR11_0_, r1_.IMLOFR as IMLOFR11_0_, r1_.IMNEFR as IMNEFR11_0_, r1_.CIVAFR as CIVAFR11_0_, r1_.CNVEFR as CNVEFR11_0_, r1_.RIC1FR as RIC126_11_0_, r1_.RIC2FR as RIC127_11_0_, r1_.RIC3FR as RIC128_11_0_, r1_.SBSPFR as SBSPFR11_0_, r1_.NBSPFR as NBSPFR11_0_, r1_.GGSPFR as GGSPFR11_0_, r1_.MMSPFR as MMSPFR11_0_, r1_.AASPFR as AASPFR11_0_, r1_.SOSPFR as SOSPFR11_0_, r1_.NRBSFR as NRBSFR11_0_, r1_.CIMBFR as CIMBFR11_0_, r1_.PNETFR as PNETFR11_0_, r1_.PLORFR as PLORFR11_0_, r1_.NCOIFR as NCOIFR11_0_, r1_.NCOFFR as NCOFFR11_0_, r1_.NRCOFR as NRCOFR11_0_, r1_.VOLUFR as VOLUFR11_0_, r1_.CDOGFR as CDOGFR11_0_, r1_.FSFAFR as FSFAFR11_0_, r1_.FDFAFR as FDFAFR11_0_, r1_.FTFAFR as FTFAFR11_0_, r1_.FLA1FR as FLA147_11_0_, r1_.FLA2FR as FLA148_11_0_, r1_.FLA3FR as FLA149_11_0_, r1_.FLA4FR as FLA150_11_0_, r1_.FLA5FR as FLA151_11_0_, r1_.FLA6FR as FLA152_11_0_, r1_.FLA7FR as FLA153_11_0_, r1_.FLA8FR as FLA154_11_0_, r1_.FL10FR as FL155_11_0_, r1_.FL20FR as FL156_11_0_, r1_.FL30FR as FL157_11_0_, r1_.PEVMFR as PEVMFR11_0_, '01' as formula8_0_, mo2_.clmama as clmama1_, mo2_.matema as matema1_, mo2_.strema as strema5_1_, mo2_.nrazma as nrazma5_1_, mo2_.dtumma as dtumma5_1_, mo2_.orumma as orumma5_1_, mo2_.blrema as blrema5_1_, mo2_.tpmama as tpmama5_1_, mo2_.de30ma as de9_5_1_, mo2_.da30ma as da10_5_1_, mo2_.dc20ma as dc11_5_1_, mo2_.df30ma as df12_5_1_, mo2_.ustuma as ustuma5_1_, mo2_.umgema as umgema5_1_, mo2_.umcoma as umcoma5_1_, mo2_.umavma as umavma5_1_, mo2_.fumcma as fumcma5_1_, mo2_.fumama as fumama5_1_, mo2_.maeqma as maeqma5_1_, mo2_.cmpmma as cmpmma5_1_, mo2_.cctgma as cctgma5_1_, mo2_.cfcama as cfcama5_1_, mo2_.dimama as dimama5_1_, mo2_.peunma as peunma5_1_, mo2_.umpema as umpema5_1_, mo2_.hmatma as hmatma5_1_, mo2_.lsmama as lsmama5_1_, mo2_.civama as civama5_1_, mo2_.cnvema as cnvema5_1_, mo2_.cnaqma as cnaqma5_1_, mo2_.cdfoma as cdfoma5_1_, mo2_.arfoma as arfoma5_1_, mo2_.tcfoma as tcfoma5_1_, mo2_.tiapma as tiapma5_1_, mo2_.sminma as sminma5_1_, mo2_.lrioma as lrioma5_1_, mo2_.coulma as coulma5_1_, mo2_.ggcuma as ggcuma5_1_, mo2_.mmcuma as mmcuma5_1_, mo2_.aacuma as aacuma5_1_, mo2_.socuma as socuma5_1_, mo2_.compma as compma5_1_, mo2_.ggcmma as ggcmma5_1_, mo2_.mmcmma as mmcmma5_1_, mo2_.aacmma as aacmma5_1_, mo2_.socmma as socmma5_1_, mo2_.costma as costma5_1_, mo2_.ggcsma as ggcsma5_1_, mo2_.mmcsma as mmcsma5_1_, mo2_.aacsma as aacsma5_1_, mo2_.socsma as socsma5_1_, mo2_.coopma as coopma5_1_, mo2_.copema as copema5_1_, mo2_.cocoma as cocoma5_1_, mo2_.cofuma as cofuma5_1_, mo2_.coofma as coofma5_1_, mo2_.cog1ma as cog57_5_1_, mo2_.cog2ma as cog58_5_1_, mo2_.cfvcma as cfvcma5_1_, mo2_.tdmama as tdmama5_1_, mo2_.impema as impema5_1_, mo2_.cma1ma as cma62_5_1_, mo2_.cma2ma as cma63_5_1_, mo2_.cma3ma as cma64_5_1_, mo2_.cma4ma as cma65_5_1_, mo2_.cma5ma as cma66_5_1_, mo2_.fgpzma as fgpzma5_1_, mo2_.fla1ma as fla68_5_1_, mo2_.fla2ma as fla69_5_1_, mo2_.fla3ma as fla70_5_1_, mo2_.fla4ma as fla71_5_1_, mo2_.fla5ma as fla72_5_1_, mo2_.fla6ma as fla73_5_1_, mo2_.fla7ma as fla74_5_1_, mo2_.fla8ma as fla75_5_1_, mo2_.fl10ma as fl76_5_1_, mo2_.fl20ma as fl77_5_1_, mo2_.fl30ma as fl78_5_1_, mo2_.ceulma as ceulma5_1_, mo2_.cempma as cempma5_1_, mo2_.cestma as cestma5_1_, mo2_.ceopma as ceopma5_1_, mo2_.cepema as cepema5_1_, mo2_.cecoma as cecoma5_1_, mo2_.cefuma as cefuma5_1_, mo2_.ceofma as ceofma5_1_, mo2_.ceg1ma as ceg87_5_1_, mo2_.ceg2ma as ceg88_5_1_, mo2_.AVANMA as AVANMA5_1_, 'AVA' as formula3_1_, ccodiceava6_.cdtbtb as cdtbtb2_, ccodiceava6_.cdeltb as cdeltb2_, ccodiceava6_.DATITB as DATITB0_2_ from sdgtwb_dat.fatte00f this_ inner join sdgtwb_dat.fatri00f r1_ on this_.SOFAFT=r1_.SOFAFR and this_.AAFAFT=r1_.AAFAFR and this_.SFATFT=r1_.SFATFR and this_.NFATFT=r1_.NFATFR inner join sdgtwb_dat.arcma00f mo2_ on '01'=mo2_.clmama and r1_.MATEFR=mo2_.matema left outer join sdgtwb_dat.arctb00f ccodiceava6_ on 'AVA'=ccodiceava6_.cdtbtb and mo2_.AVANMA=ccodiceava6_.cdeltb where this_.SOFAFT=? and this_.AAFAFT=? and this_.SFATFT=? and this_.NFATFT=? order by mo2_.da30ma asc
11:29:41,265 WARN JDBCExceptionReporter:71 - SQL Error: -208, SQLState: 42707
11672 [Thread-13] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: -208, SQLState: 42707
11:29:41,265 ERROR JDBCExceptionReporter:72 - [SQL0208] La colonna ORDER BY DA30MA o l'espressione non si trova nella tabella risultati.
11672 [Thread-13] ERROR org.hibernate.util.JDBCExceptionReporter - [SQL0208] La colonna ORDER BY DA30MA o l'espressione non si trova nella tabella risultati.
11:29:41,343 FATAL html:54 - could not execute query
11750 [Thread-13] FATAL logs.html - could not execute query