升级前:
hibernate-core.jar:3.3.1.GA
hibernate-entitymanager.jar:3.4.0.GA
hibernate-annotation.jar:3.4.0.GA
升级后:
hibernate-core.jar:3.3.2.GA_CP05
hibernate-entitymanager.jar:3.4.0.GA_CP05
hibernate-annotation.jar:3.4.0.GA_CP05
2)从服务器,我发现hibernate使用不存在的列别名(agreeme17_69_17_)从结果集获取值.
3),我发现完全相同的问题:https://forum.hibernate.org/viewtopic.php?f=1&t=968677 —由此,问题是由于未在本机sql中的select子句中明确指定所有列引起的.
4)但是我在映射文件中使用非本机sql的注释,所有列都应包含在select子句中.
5)当我把所有的hibernate * jar替换成旧的,它再次工作.
/错误日志/
2013-12-04 13:34:48,415 TRACE [org.hibernate.type.BooleanType](http-0.0.0.0-8080-2 :)将“true”作为列返回:useIss118_69_15_
2013-12-04 13:34:48,415 SEVERE [oracle.jdbc.driver](http-0.0.0.0-8080-2 :)投掷sqlException:6
2013-12-04 13:34:48,423 INFO [org.hibernate.type.LongType](http-0.0.0.0-8080-2 :)无法从结果集中读取列值:agreeme17_69_17_;列名无效
2013-12-04 13:34:48,423 DEBUG [org.hibernate.jdbc.AbstractBatcher](http-0.0.0.0-8080-2 :)关闭ResultSet(打开ResultSet:1,全局:1)
2013-12-04 13:34:48,423 DEBUG [org.hibernate.jdbc.AbstractBatcher](http-0.0.0.0-8080-2 :)即将关闭PreparedStatement(打开PreparedStatements:1,423 TRACE [org.hibernate.jdbc.AbstractBatcher](http-0.0.0.0-8080-2 :)关闭声明
/ sql /
/* Formatted on 12/4/2013 4:01:46 PM (QP5 v5.114.809.3010) */ SELECT * FROM ( SELECT this_.id AS id69_15_,this_.agreementName AS agreemen2_69_15_,this_.agreementType AS agreemen3_69_15_,this_.allowNegEffRate AS allowNeg4_69_15_,this_.annexes AS annexes69_15_,this_.autoBookApplicability AS autoBook6_69_15_,this_.autoBooking AS autoBook7_69_15_,this_.baseCurrency AS baseCurr8_69_15_,this_.businessLine AS business9_69_15_,this_.calcAgentCpty AS calcAge10_69_15_,this_.calcAgentPrinc AS calcAge11_69_15_,this_.calcRule AS calcRule69_15_,this_.calculationDate AS calcula13_69_15_,this_.callReturnBucketId AS callRet14_69_15_,this_.category AS category69_15_,this_.ccp AS ccp69_15_,this_.cobValuationDateId AS cobValu17_69_15_,this_.colManager AS colManager69_15_,this_.colType AS colType69_15_,this_.umbrellaRule AS umbrel115_69_15_,this_.comments AS comments69_15_,this_.compoundInterestCalc AS compoun21_69_15_,this_.concLimitTrigger AS concLim22_69_15_,this_.conditionRule AS conditi23_69_15_,this_.confirmationLetterTarget AS confirm24_69_15_,this_.cptyCCContact AS cptyCCC25_69_15_,this_.cptyCollatralNetValuation AS cptyCol26_69_15_,this_.cptyIMSeg AS cptyIMSeg69_15_,this_.cptyInterestCCContact AS cptyInt28_69_15_,this_.cptyInterestContact AS cptyIn119_69_15_,this_.cptyContact AS cptyCo120_69_15_,this_.counterpartyHQ AS counte121_69_15_,this_.cptySettleMethod AS cptySet29_69_15_,this_.cptyVMSeg AS cptyVMSeg69_15_,this_.creationDate AS creatio31_69_15_,this_.custodianId AS custodi34_69_15_,this_.custodianCCContact AS custodi32_69_15_,this_.custodianContact AS custodi33_69_15_,this_.description AS descrip35_69_15_,this_.disablecomment AS disable36_69_15_,this_.disableinfo AS disable37_69_15_,this_.distMedium AS distMedium69_15_,this_.creditsupportdoc AS credit122_69_15_,this_.edittingCompleted AS edittin39_69_15_,this_.effectiveDate AS effecti40_69_15_,this_.eligRulesTemplateId AS eligRul41_69_15_,this_.enableInterestCalc AS enableI42_69_15_,this_.exposureProfile AS exposur43_69_15_,this_.exposureStatementTemplateType AS exposur44_69_15_,this_.extId AS extId69_15_,this_.genLock AS genLock69_15_,this_.groupId AS groupId69_15_,this_.imCalcRule AS imCalcRule69_15_,this_.IMCallReturnBucketId AS IMCallR49_69_15_,this_.imCompInterestCalc AS imCompI50_69_15_,this_.imCptySettleMethod AS imCptyS51_69_15_,this_.imEnableInterestCalc AS imEnabl52_69_15_,this_.IMPaymentBucketId AS IMPayme53_69_15_,this_.imPrinSettleMethod AS imPrinS54_69_15_,this_.IMRecallDeliveryBucketId AS IMRecal55_69_15_,this_.IMReceiveBucketId AS IMRecei56_69_15_,this_.imRoundingDelivery AS imRound57_69_15_,this_.imRoundingRecall AS imRound58_69_15_,this_.imStd AS imStd69_15_,this_.includeFailTradeValueCloseLeg AS include60_69_15_,this_.includeFailTradeValueOpenLeg AS include61_69_15_,this_.isMultiModel AS isMulti62_69_15_,this_.jurisdiction AS jurisdi63_69_15_,this_.lastModifiedBy AS lastMod64_69_15_,this_.letterTemplateType AS letterT65_69_15_,this_.marketDataId AS marketD66_69_15_,this_.navCpty AS navCpty69_15_,this_.navCptyCur AS navCptyCur69_15_,this_.navPrincipal AS navPrin69_69_15_,this_.navPrincipalCur AS navPrin70_69_15_,this_.netEvent AS netEvent69_15_,this_.netInterest AS netInte72_69_15_,this_.nettingCalc AS netting73_69_15_,this_.nettingInterest AS netting74_69_15_,this_.nettingMTMAndIA AS netting75_69_15_,this_.notes AS notes69_15_,this_.notificationLetterType AS notific77_69_15_,this_.owner AS owner69_15_,this_.parentId AS parentId69_15_,this_.paymentBucketId AS payment80_69_15_,this_.priceSource AS priceSo81_69_15_,this_.principalInterestContact AS princi123_69_15_,this_.principalContact AS princi124_69_15_,this_.principal AS principal69_15_,this_.princIMSeg AS princIMSeg69_15_,this_.princVmSeg AS princVmSeg69_15_,this_.principalCCContact AS princip84_69_15_,this_.principalInterestCCContact AS princip85_69_15_,this_.principalSettleMethod AS princip86_69_15_,this_.recallDeliveryBucketId AS recallD87_69_15_,this_.receiveBucketId AS receive88_69_15_,this_.reciprocity AS recipro89_69_15_,this_.region AS region69_15_,this_.regulatory AS regulatory69_15_,this_.rehypoRights AS rehypoR92_69_15_,this_.rehypoType AS rehypoType69_15_,this_.reviewDate AS reviewDate69_15_,this_.roundingDelivery AS roundin95_69_15_,this_.roundingRecall AS roundin96_69_15_,this_.settlementId AS settlem97_69_15_,this_.settlementLevel AS settlem98_69_15_,this_.signoffBy AS signoffBy69_15_,this_.signoffDate AS signof100_69_15_,this_.signoffNotes AS signof101_69_15_,this_.statementSet AS statem102_69_15_,this_.statusId AS statusId69_15_,this_.std AS std69_15_,this_.stdType AS stdType69_15_,this_.terminationDate AS termin106_69_15_,this_.tradeModelDeterminedByFeed AS tradeM107_69_15_,this_.tradeValuationRule AS tradeV108_69_15_,this_.triPartyIA AS triPartyIA69_15_,this_.tsa AS tsa69_15_,this_.tsaLevel AS tsaLevel69_15_,this_.tsaPayBucketId AS tsaPay112_69_15_,this_.tsaReceiveBucketId AS tsaRec113_69_15_,this_.tsaRule AS tsaRule69_15_,this_.umbrellaType AS umbrel116_69_15_,this_.useIssueRating AS useIss117_69_15_,this_.useIssuerRating AS useIss118_69_15_,colagreeme1_.agreementId AS agreemen2_69_17_,colagreeme1_.id AS id17_,colagreeme1_.id AS id19_0_,colagreeme1_.agreementId AS agreemen2_19_0_,colagreeme1_.genLock AS genLock19_0_,colagreeme1_.linkageId AS linkageId19_0_,orgaddress4_.Id AS Id96_1_,orgaddress4_.Address AS Address96_1_,orgaddress4_.ContactName AS ContactN3_96_1_,orgaddress4_.Email AS Email96_1_,orgaddress4_.enabled AS enabled96_1_,orgaddress4_.FaxNumber AS FaxNumber96_1_,orgaddress4_.Ftp AS Ftp96_1_,orgaddress4_.genLock AS genLock96_1_,orgaddress4_.Label AS Label96_1_,orgaddress4_.Notes AS Notes96_1_,orgaddress4_.OrgHeaderId AS OrgHead11_96_1_,orgaddress4_.sigId AS sigId96_1_,orgaddress4_.TelephoneNumber AS Telepho13_96_1_,orgaddress4_.Title AS Title96_1_,orgaddress5_.Id AS Id96_2_,orgaddress5_.Address AS Address96_2_,orgaddress5_.ContactName AS ContactN3_96_2_,orgaddress5_.Email AS Email96_2_,orgaddress5_.enabled AS enabled96_2_,orgaddress5_.FaxNumber AS FaxNumber96_2_,orgaddress5_.Ftp AS Ftp96_2_,orgaddress5_.genLock AS genLock96_2_,orgaddress5_.Label AS Label96_2_,orgaddress5_.Notes AS Notes96_2_,orgaddress5_.OrgHeaderId AS OrgHead11_96_2_,orgaddress5_.sigId AS sigId96_2_,orgaddress5_.TelephoneNumber AS Telepho13_96_2_,orgaddress5_.Title AS Title96_2_,orgheadere6_.id AS id16_3_,orgheadere6_.genLock AS genLock16_3_,orgheadere6_.LastUpdateBy AS LastUpda3_16_3_,orgheadere6_.LastUpdateTime AS LastUpda4_16_3_,orgheadere6_.lei AS lei16_3_,orgheadere6_.longName AS longName16_3_,orgheadere6_.orgCode AS orgCode16_3_,orgheadere6_.orgStatusId AS orgStatu8_16_3_,orgheadere6_.shortName AS shortName16_3_,orgheadere6_.status AS status16_3_,orgudfejb3x7_.id AS id3_4_,orgudfejb3x7_.genLock AS genLock3_4_,orgudfejb3x7_.UDF1 AS UDF3_3_4_,orgudfejb3x7_.UDF10 AS UDF4_3_4_,orgudfejb3x7_.UDF11 AS UDF5_3_4_,orgudfejb3x7_.UDF12 AS UDF6_3_4_,orgudfejb3x7_.UDF13 AS UDF7_3_4_,orgudfejb3x7_.UDF14 AS UDF8_3_4_,orgudfejb3x7_.UDF15 AS UDF9_3_4_,orgudfejb3x7_.UDF16 AS UDF10_3_4_,orgudfejb3x7_.UDF17 AS UDF11_3_4_,orgudfejb3x7_.UDF18 AS UDF12_3_4_,orgudfejb3x7_.UDF19 AS UDF13_3_4_,orgudfejb3x7_.UDF2 AS UDF14_3_4_,orgudfejb3x7_.UDF20 AS UDF15_3_4_,orgudfejb3x7_.UDF21 AS UDF16_3_4_,orgudfejb3x7_.UDF22 AS UDF17_3_4_,orgudfejb3x7_.UDF23 AS UDF18_3_4_,orgudfejb3x7_.UDF24 AS UDF19_3_4_,orgudfejb3x7_.UDF25 AS UDF20_3_4_,orgudfejb3x7_.UDF26 AS UDF21_3_4_,orgudfejb3x7_.UDF27 AS UDF22_3_4_,orgudfejb3x7_.UDF28 AS UDF23_3_4_,orgudfejb3x7_.UDF29 AS UDF24_3_4_,orgudfejb3x7_.UDF3 AS UDF25_3_4_,orgudfejb3x7_.UDF30 AS UDF26_3_4_,orgudfejb3x7_.UDF4 AS UDF27_3_4_,orgudfejb3x7_.UDF5 AS UDF28_3_4_,orgudfejb3x7_.UDF6 AS UDF29_3_4_,orgudfejb3x7_.UDF7 AS UDF30_3_4_,orgudfejb3x7_.UDF8 AS UDF31_3_4_,orgudfejb3x7_.UDF9 AS UDF32_3_4_,orgheadere8_.id AS id16_5_,orgheadere8_.genLock AS genLock16_5_,orgheadere8_.LastUpdateBy AS LastUpda3_16_5_,orgheadere8_.LastUpdateTime AS LastUpda4_16_5_,orgheadere8_.lei AS lei16_5_,orgheadere8_.longName AS longName16_5_,orgheadere8_.orgCode AS orgCode16_5_,orgheadere8_.orgStatusId AS orgStatu8_16_5_,orgheadere8_.shortName AS shortName16_5_,orgheadere8_.status AS status16_5_,orgaddress9_.Id AS Id96_6_,orgaddress9_.Address AS Address96_6_,orgaddress9_.ContactName AS ContactN3_96_6_,orgaddress9_.Email AS Email96_6_,orgaddress9_.enabled AS enabled96_6_,orgaddress9_.FaxNumber AS FaxNumber96_6_,orgaddress9_.Ftp AS Ftp96_6_,orgaddress9_.genLock AS genLock96_6_,orgaddress9_.Label AS Label96_6_,orgaddress9_.Notes AS Notes96_6_,orgaddress9_.OrgHeaderId AS OrgHead11_96_6_,orgaddress9_.sigId AS sigId96_6_,orgaddress9_.TelephoneNumber AS Telepho13_96_6_,orgaddress9_.Title AS Title96_6_,colrefdata10_.id AS id94_7_,colrefdata10_.category AS category94_7_,colrefdata10_.description AS descript3_94_7_,colrefdata10_.scheme AS scheme94_7_,colrefdata10_.status AS status94_7_,colrefdata10_.refdatavalue AS refdatav6_94_7_,orgaddress11_.Id AS Id96_8_,orgaddress11_.Address AS Address96_8_,orgaddress11_.ContactName AS ContactN3_96_8_,orgaddress11_.Email AS Email96_8_,orgaddress11_.enabled AS enabled96_8_,orgaddress11_.FaxNumber AS FaxNumber96_8_,orgaddress11_.Ftp AS Ftp96_8_,orgaddress11_.genLock AS genLock96_8_,orgaddress11_.Label AS Label96_8_,orgaddress11_.Notes AS Notes96_8_,orgaddress11_.OrgHeaderId AS OrgHead11_96_8_,orgaddress11_.sigId AS sigId96_8_,orgaddress11_.TelephoneNumber AS Telepho13_96_8_,orgaddress11_.Title AS Title96_8_,orgaddress12_.Id AS Id96_9_,orgaddress12_.Address AS Address96_9_,orgaddress12_.ContactName AS ContactN3_96_9_,orgaddress12_.Email AS Email96_9_,orgaddress12_.enabled AS enabled96_9_,orgaddress12_.FaxNumber AS FaxNumber96_9_,orgaddress12_.Ftp AS Ftp96_9_,orgaddress12_.genLock AS genLock96_9_,orgaddress12_.Label AS Label96_9_,orgaddress12_.Notes AS Notes96_9_,orgaddress12_.OrgHeaderId AS OrgHead11_96_9_,orgaddress12_.sigId AS sigId96_9_,orgaddress12_.TelephoneNumber AS Telepho13_96_9_,orgaddress12_.Title AS Title96_9_,orgheadere13_.id AS id16_10_,orgheadere13_.genLock AS genLock16_10_,orgheadere13_.LastUpdateBy AS LastUpda3_16_10_,orgheadere13_.LastUpdateTime AS LastUpda4_16_10_,orgheadere13_.lei AS lei16_10_,orgheadere13_.longName AS longName16_10_,orgheadere13_.orgCode AS orgCode16_10_,orgheadere13_.orgStatusId AS orgStatu8_16_10_,orgheadere13_.shortName AS shortName16_10_,orgheadere13_.status AS status16_10_,statement14_.agreementId AS agreeme17_69_18_,statement14_.id AS id18_,statement14_.id AS id1_11_,statement14_.ITMExposure AS ITMExpos2_1_11_,statement14_.ITMMarginReq AS ITMMargi3_1_11_,statement14_.OTMExposure AS OTMExpos4_1_11_,statement14_.OTMMarginReq AS OTMMargi5_1_11_,statement14_.accruedCoupon AS accruedC6_1_11_,statement14_.adjCtpyColVal AS adjCtpyC7_1_11_,statement14_.adjExposureAmnt AS adjExpos8_1_11_,statement14_.adjITMExposureAmnt AS adjITMEx9_1_11_,statement14_.adjIaExpAmt AS adjIaEx10_1_11_,statement14_.adjMtmExpAmt AS adjMtmE11_1_11_,statement14_.adjMtmItmExpAmt AS adjMtmI12_1_11_,statement14_.adjMtmOtmExpAmt AS adjMtmO13_1_11_,statement14_.adjOTMExposureAmnt AS adjOTME14_1_11_,statement14_.adjPrincColVal AS adjPrin15_1_11_,statement14_.agreementExposureAdj AS agreeme16_1_11_,statement14_.agreementId AS agreeme17_1_11_,statement14_.agreementType AS agreeme18_1_11_,statement14_.cashAvailable AS cashAva19_1_11_,statement14_.confirmedColDelivered AS confirm20_1_11_,statement14_.confirmedColHeld AS confirm21_1_11_,statement14_.counterpartyId AS counter25_1_11_,statement14_.counterpartyCalExtIA AS counter22_1_11_,statement14_.counterpartyExtIA AS counter23_1_11_,statement14_.counterpartyIA AS counter24_1_11_,statement14_.CptyExtIAModifyTime AS CptyExt26_1_11_,statement14_.ctpyIMThreshold AS ctpyIMT27_1_11_,statement14_.ctpyImMinTransAmnt AS ctpyImM28_1_11_,statement14_.ctpyImRoundingAmnt AS ctpyImR29_1_11_,statement14_.ctpyMinTransAmnt AS ctpyMin30_1_11_,statement14_.ctpyRoundingAmnt AS ctpyRou31_1_11_,statement14_.ctpyThreshold AS ctpyThr32_1_11_,statement14_.curLockupMarginCpty AS curLock33_1_11_,statement14_.curLockupMarginPrinc AS curLock34_1_11_,statement14_.dateMissMatchFxRate AS dateMis35_1_11_,statement14_.dateMissMatchSecurity AS dateMis36_1_11_,statement14_.deliveryAmnt AS deliver37_1_11_,statement14_.excludeCollateral AS exclude38_1_11_,statement14_.ExtIACurrencyId AS ExtIACu39_1_11_,statement14_.genLock AS genLock1_11_,statement14_.iaConflict AS iaConflict1_11_,statement14_.iaDeliveryAmnt AS iaDeliv42_1_11_,statement14_.iaRecallAmnt AS iaRecal43_1_11_,statement14_.imCashBalance AS imCashB44_1_11_,statement14_.imED AS imED1_11_,statement14_.imMktCashBalance AS imMktCa46_1_11_,statement14_.imMktSecuritiesCol AS imMktSe47_1_11_,statement14_.imRequirement AS imRequi48_1_11_,statement14_.imSecuritiesCol AS imSecur49_1_11_,statement14_.inTotalExposure AS inTotal50_1_11_,statement14_.lastUpdated AS lastUpd51_1_11_,statement14_.lockupDelvCtpy AS lockupD52_1_11_,statement14_.lockupDelvPrinc AS lockupD53_1_11_,statement14_.lockupMarginCallCpty AS lockupM54_1_11_,statement14_.lockupMarginCallPrinc AS lockupM55_1_11_,statement14_.lockupMarginReqCpty AS lockupM56_1_11_,statement14_.lockupMarginReqPrinc AS lockupM57_1_11_,statement14_.lockupRetunPrinc AS lockupR58_1_11_,statement14_.lockupReturnCtpy AS lockupR59_1_11_,statement14_.marginCtpyIA AS marginC60_1_11_,statement14_.marginDelvCtpy AS marginD61_1_11_,statement14_.marginDelvPrinc AS marginD62_1_11_,statement14_.marginPrincipalIA AS marginP63_1_11_,statement14_.marginReturnCtpy AS marginR64_1_11_,statement14_.marginReturnPrinc AS marginR65_1_11_,statement14_.marginTotalExpAmnt AS marginT66_1_11_,statement14_.mktValAssetCtpy AS mktValA67_1_11_,statement14_.mktValAssetPrinc AS mktValA68_1_11_,statement14_.mtmExposure AS mtmExpo69_1_11_,statement14_.netCashValue AS netCash70_1_11_,statement14_.netED AS netED1_11_,statement14_.netMarginReq AS netMarg72_1_11_,statement14_.netNonSysCalValue AS netNonS73_1_11_,statement14_.netSecurityValue AS netSecu74_1_11_,statement14_.notes AS notes1_11_,statement14_.notifTime AS notifTime1_11_,statement14_.outTotalExposure AS outTota77_1_11_,statement14_.overwriteIAWithExtIA AS overwri78_1_11_,statement14_.pendingColDelivered AS pending79_1_11_,statement14_.pendingColHeld AS pending80_1_11_,statement14_.portfolioChangedPerc AS portfol81_1_11_,statement14_.prevIoUsTotalExposure AS prevIoU82_1_11_,statement14_.priceMissed AS priceMi83_1_11_,statement14_.priceMissedRepoTrade AS priceMi84_1_11_,statement14_.PrincExtIAModifyTime AS PrincEx85_1_11_,statement14_.princIMThreshold AS princIM86_1_11_,statement14_.princImMinTransAmnt AS princIm87_1_11_,statement14_.princImRoundingAmnt AS princIm88_1_11_,statement14_.princMinTransAmnt AS princMi89_1_11_,statement14_.princRoundingAmnt AS princRo90_1_11_,statement14_.princThreshold AS princTh91_1_11_,statement14_.principalCalExtIA AS princip92_1_11_,statement14_.principalExtIA AS princip93_1_11_,statement14_.principalIA AS princip94_1_11_,statement14_.ratingContigentIdCpty AS ratingC95_1_11_,statement14_.ratingContigentIdPrin AS ratingC96_1_11_,statement14_.recallAmnt AS recallAmnt1_11_,statement14_.reciprocity AS recipro98_1_11_,statement14_.relationship AS relatio99_1_11_,statement14_.reportingCur AS report100_1_11_,statement14_.resolutionTime AS resolu101_1_11_,statement14_.sameDay AS sameDay1_11_,statement14_.specialReminder AS specia103_1_11_,statement14_.systemCalcCounterpartyExtIA AS system104_1_11_,statement14_.systemCalcPrincipalExtIA AS system105_1_11_,statement14_.timeZone AS timeZone1_11_,statement14_.totalExposure AS totalE107_1_11_,statement14_.totalNotional AS totalN108_1_11_,statement14_.totalSettlementAmt AS totalS109_1_11_,statement14_.tradeConflict AS tradeC110_1_11_,statement14_.tradeIneligible AS tradeI111_1_11_,statement14_.tradesCount AS trades112_1_11_,statement14_.tsaConflict AS tsaCon113_1_11_,statement14_.valuationDate AS valuat114_1_11_,statement14_.valuationFreqPeriod AS valuat115_1_11_,statement14_.valueIAColDelivered AS valueI116_1_11_,statement14_.valueIAColHeld AS valueI117_1_11_,statement14_.variationMargin AS variat118_1_11_,statement14_.vmCashBalance AS vmCash119_1_11_,statement14_.vmED AS vmED1_11_,statement14_.vmMktCashBalance AS vmMktC121_1_11_,statement14_.vmMktSecuritiesCol AS vmMktS122_1_11_,statement14_.vmSecuritiesCol AS vmSecu123_1_11_,statement14_.wrongFxCol AS wrongFxCol1_11_,statement14_.wrongFxExp AS wrongFxExp1_11_,statement14_.wrongPriceExp AS wrongP126_1_11_,colstateme15_.id AS id43_12_,colstateme15_.agreementId AS agreemen2_43_12_,colstateme15_.lastApproved AS lastAppr3_43_12_,colstateme15_.statusId AS statusId43_12_,stmteligib16_.agreementId AS agreemen2_69_,stmteligib16_.id AS id,stmteligib16_.id AS id44_13_,stmteligib16_.agreementId AS agreemen2_44_13_,stmteligib16_.calcTime AS calcTime44_13_,stmteligib16_.clBreached AS clBreached44_13_,stmteligib16_.ineligible AS ineligible44_13_,colagreeme17_.agreementId AS agreemen1_7_14_,colagreeme17_.messageAttachmentMedium AS messageA2_7_14_,colagreeme17_.interfaceSystem AS interfac3_7_14_,colagreeme17_.messageAgreementId AS messageA4_7_14_,colagreeme17_.messageWorkflowType AS messageW5_7_14_,colagreeme17_.responseToleranceAmount AS response6_7_14_,colagreeme17_.responseToleranceCurrency AS response7_7_14_ FROM ColAgreementHeader this_ LEFT OUTER JOIN COLAGREEMENTLINKAGE colagreeme1_ ON this_.id = colagreeme1_.agreementId LEFT OUTER JOIN OrgAddress orgaddress4_ ON this_.cptyInterestContact = orgaddress4_.Id LEFT OUTER JOIN OrgAddress orgaddress5_ ON this_.cptyContact = orgaddress5_.Id INNER JOIN OrgHeader orgheadere6_ ON this_.counterpartyHQ = orgheadere6_.id LEFT OUTER JOIN OrgUDF orgudfejb3x7_ ON orgheadere6_.id = orgudfejb3x7_.id LEFT OUTER JOIN OrgHeader orgheadere8_ ON this_.custodianId = orgheadere8_.id LEFT OUTER JOIN OrgAddress orgaddress9_ ON this_.custodianContact = orgaddress9_.Id INNER JOIN ColRefData colrefdata10_ ON this_.creditsupportdoc = colrefdata10_.id LEFT OUTER JOIN OrgAddress orgaddress11_ ON this_.principalInterestContact = orgaddress11_.Id LEFT OUTER JOIN OrgAddress orgaddress12_ ON this_.principalContact = orgaddress12_.Id INNER JOIN OrgHeader orgheadere13_ ON this_.principal = orgheadere13_.id LEFT OUTER JOIN ColStatement statement14_ ON this_.id = statement14_.agreementId LEFT OUTER JOIN ColStatementStatus colstateme15_ ON statement14_.id = colstateme15_.id LEFT OUTER JOIN ColStmtEligibleCalc stmteligib16_ ON this_.id = stmteligib16_.agreementId LEFT OUTER JOIN ColAgreementHeaderDetails colagreeme17_ ON this_.id = colagreeme17_.agreementId WHERE this_.umbrellaType <> ? AND this_.businessLine IN (?,?,?) AND colagreeme1_.linkageId LIKE ? ORDER BY this_.id ASC) WHERE ROWNUM <= ?
/ colstatement schema //
//导致错误的2个实体bean的关联
所以你的ColAgreementLinkageEJB3将包含:
@Column(name = "AGREEMENT_ID") private Long agreementId; @ManyToOne(fetch = FetchType.LAZY,optional = true) @JoinColumn(name = "AGREEMENT_ID",referencedColumnName = "ID",insertable = false,updatable = false) private ColAgreementHeaderEJB3 header;
请注意,您不需要将可插入/可更新参数放在列定义上.
您的ColAgreementHeaderEJB3实体将包含:
@OneToMany(mappedBy = "header",fetch = FetchType.LAZY) private Set<ColAgreementLinkageEJB3> linkageSet;
此外,您不需要@NotFound注释,因为一对多关系本质上是一对多或多.
如果要始终加载一组链接,您将使用FetchType EAGER.