Here is another query not behaving as the documentation suggests.
I added the left join fetch one by one to try to cover all tables in the m*n+1 selects I was getting. Apparently there is a limit, I must have missed this in the documentation.
Here is the log
Code:
2009-01-3015:12:17.406 GMT+0000 277766 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.hibernate.hql.classic.QueryTranslatorImpl - HQL: select inst from InstrumentDomain as inst left join fetch inst.instrumentIdentifier ident left join fetch ident.schemeInfo info left join fetch inst.instrumentType as itype left join fetch inst.denomination denom left join fetch denom.currency as currency left join fetch inst.industryIdentifier industry left join fetch inst.lastCAE lastCAE left join fetch inst.issuerClass issr left join fetch inst.issueData issd left join fetch inst.debtIssueData dissd left join fetch inst.underlyingInstrument undly left join fetch inst.underlyingCount undlycount left join fetch issr.location loc left join fetch issd.portfolioDomain pdom left join fetch issd.marketStatsClass mrkts left join fetch issd.underlyingCount ucnt left join fetch issd.issueAmount issamt left join fetch loc.country cntry left join fetch loc.locationType loctyp where itype.id in (46,48,49,150,151,185,432,438,439,443,473) and inst.name like ?
2009-01-3015:12:17.421 GMT+0000 277781 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.hibernate.hql.classic.QueryTranslatorImpl - SQL: select instrument0_.`id` as id1_165_0_, denominati4_.`id` as id1_101_1_, schemeinfo2_.`id` as id1_290_2_, location13_.`id` as id1_200_3_, lastcae7_.`id` as id1_196_4_, portfoliod14_.`id` as id1_245_5_, instrument3_.`id` as id1_171_6_, country17_.`id` as id1_77_7_, issuerclas8_.`id` as id1_191_8_, debtissued10_.`id` as id1_92_9_, underlying11_.`id` as id1_165_10_, underlying12_.`id` as id1_329_11_, instrument1_.`id` as id1_168_12_, issueamoun16_.`id` as id1_180_13_, industryid6_.`id` as id1_162_14_, currency5_.`id` as id1_83_15_, issuedata9_.`id` as id1_181_16_, locationty18_.`id` as id1_201_17_, marketstat15_.`id` as id1_208_18_, instrument0_.`instrumenttype` as instrume2_165_0_, instrument0_.`instrumentformtype` as instrume3_165_0_, instrument0_.`tradingrestrictionstype` as tradingr4_165_0_, instrument0_.`amountoutstanding` as amountou5_165_0_, instrument0_.`amountoutstandingdate` as amountou6_165_0_, instrument0_.`benchmarkstrategy` as benchmar7_165_0_, instrument0_.`contractvaluemultiplier` as contract8_165_0_, instrument0_.`createdate` as createdate9_165_0_, instrument0_.`defaultclause` as default10_165_0_, instrument0_.`firstamount` as firstam11_165_0_, instrument0_.`firstdate` as firstdate12_165_0_, instrument0_.`firstdealingdate` as firstde13_165_0_, instrument0_.`firsteventvalue` as firstev14_165_0_, instrument0_.`firstsettlementdate` as firstse15_165_0_, instrument0_.`lastamount` as lastamount16_165_0_, instrument0_.`lastdate` as lastdate17_165_0_, instrument0_.`lasteventvalue` as lasteve18_165_0_, instrument0_.`marketderivedinfperiddration` as marketd19_165_0_, instrument0_.`marketderivedinfoperiodend` as marketd20_165_0_, instrument0_.`marketderivedinfoperiodstart` as marketd21_165_0_, instrument0_.`modifieddate` as modifie22_165_0_, instrument0_.`name` as name23_165_0_, instrument0_.`nextamount` as nextamount24_165_0_, instrument0_.`nexteventvalue` as nexteve25_165_0_, instrument0_.`numberholders` as numberh26_165_0_, instrument0_.`numberholdersdatetime` as numberh27_165_0_, instrument0_.`nmberholderspreviousdatetime` as nmberho28_165_0_, instrument0_.`objective` as objective29_165_0_, instrument0_.`penultimateamount` as penulti30_165_0_, instrument0_.`penultimatedate` as penulti31_165_0_, instrument0_.`principalpaymentend` as princip32_165_0_, instrument0_.`principalpaymentstart` as princip33_165_0_, instrument0_.`purchasingminimums` as purchas34_165_0_, instrument0_.`qualifiedplans` as qualifi35_165_0_, instrument0_.`recurrable` as recurrable36_165_0_, instrument0_.`shortname` as shortname37_165_0_, instrument0_.`instrumentdomain` as instrum38_165_0_, instrument0_.`issuerclass` as issuerc39_165_0_, denominati4_.`calculationtype` as calculat2_101_1_, denominati4_.`indicatorstype` as indicato3_101_1_, denominati4_.`marketcenter` as marketce4_101_1_, denominati4_.`quantitydescirptiontype` as quantity5_101_1_, denominati4_.`quantitytype` as quantity6_101_1_, denominati4_.`valuationref` as valuatio7_101_1_, denominati4_.`valuationtype` as valuatio8_101_1_, denominati4_.`crossrate` as crossrate9_101_1_, denominati4_.`currency` as currency10_101_1_, denominati4_.`instrumentdomain` as instrum11_101_1_, denominati4_.`datetime` as datetime12_101_1_, denominati4_.`denomination` as denomin13_101_1_, denominati4_.`increment` as increment14_101_1_, denominati4_.`minval` as minval15_101_1_, denominati4_.`size` as size16_101_1_, denominati4_.`debtissuedata` as debtiss17_101_1_, schemeinfo2_.`displayname` as displayn2_290_2_, schemeinfo2_.`longname` as longname3_290_2_, schemeinfo2_.`scheme` as scheme4_290_2_, schemeinfo2_.`shortname` as shortname5_290_2_, location13_.`locationtype` as location2_200_3_, location13_.`country` as country3_200_3_, location13_.`address` as address4_200_3_, location13_.`city` as city5_200_3_, location13_.`end` as end6_200_3_, location13_.`faxnumber` as faxnumber7_200_3_, location13_.`municipality` as municipa8_200_3_, location13_.`postalcode` as postalcode9_200_3_, location13_.`postalcodescheme` as postalc10_200_3_, location13_.`regionname` as regionname11_200_3_, location13_.`start` as start12_200_3_, location13_.`stateorprovincename` as stateor13_200_3_, location13_.`telephonenumber` as telepho14_200_3_, location13_.`websiteurl` as websiteurl15_200_3_, location13_.`issuedata` as issuedata16_200_3_, location13_.`businessclass` as busines17_200_3_, location13_.`counterpartyclass` as counter18_200_3_, location13_.`issuerclass` as issuerc19_200_3_, lastcae7_.`caetype` as caetype2_196_4_, lastcae7_.`datetime` as datetime3_196_4_, portfoliod14_.`industryidentifier` as industry2_245_5_, portfoliod14_.`underlying` as underlying3_245_5_, portfoliod14_.`underlyingcount` as underlyi4_245_5_, portfoliod14_.issueData as issueData245_5_, instrument3_.`full` as full2_171_6_, instrument3_.`scheme` as scheme3_171_6_, instrument3_.`short` as short4_171_6_, country17_.`country` as country2_77_7_, country17_.`scheme` as scheme3_77_7_, issuerclas8_.`entitystatustype` as entityst2_191_8_, issuerclas8_.`replacemententity` as replacem3_191_8_, issuerclas8_.`replacementtype` as replacem4_191_8_, issuerclas8_.`comment` as comment5_191_8_, issuerclas8_.`createdate` as createdate6_191_8_, issuerclas8_.`creationdate` as creation7_191_8_, issuerclas8_.`duration` as duration8_191_8_, issuerclas8_.`end` as end9_191_8_, issuerclas8_.`incorpdate` as incorpdate10_191_8_, issuerclas8_.`modifieddate` as modifie11_191_8_, issuerclas8_.`name` as name12_191_8_, issuerclas8_.`parentid` as parentid13_191_8_, issuerclas8_.`reviewdate` as reviewdate14_191_8_, issuerclas8_.`shortname` as shortname15_191_8_, issuerclas8_.`start` as start16_191_8_, issuerclas8_.`ultimateparentid` as ultimat17_191_8_, debtissued10_.convertible as converti2_92_9_, debtissued10_.`debtindicatorstype` as debtindi3_92_9_, debtissued10_.`striptype` as striptype4_92_9_, debtissued10_.`strippbleinstrmentidentifier` as strippbl5_92_9_, debtissued10_.`coupontype` as coupontype6_92_9_, debtissued10_.`createdate` as createdate7_92_9_, debtissued10_.`modifieddate` as modified8_92_9_, debtissued10_.`overallotment` as overallo9_92_9_, debtissued10_.`strippable` as strippable10_92_9_, debtissued10_.`subscriptionduration` as subscri11_92_9_, debtissued10_.`subscriptionend` as subscri12_92_9_, debtissued10_.`subscriptionminval` as subscri13_92_9_, debtissued10_.`subscriptionstart` as subscri14_92_9_, underlying11_.`instrumenttype` as instrume2_165_10_, underlying11_.`instrumentformtype` as instrume3_165_10_, underlying11_.`tradingrestrictionstype` as tradingr4_165_10_, underlying11_.`amountoutstanding` as amountou5_165_10_, underlying11_.`amountoutstandingdate` as amountou6_165_10_, underlying11_.`benchmarkstrategy` as benchmar7_165_10_, underlying11_.`contractvaluemultiplier` as contract8_165_10_, underlying11_.`createdate` as createdate9_165_10_, underlying11_.`defaultclause` as default10_165_10_, underlying11_.`firstamount` as firstam11_165_10_, underlying11_.`firstdate` as firstdate12_165_10_, underlying11_.`firstdealingdate` as firstde13_165_10_, underlying11_.`firsteventvalue` as firstev14_165_10_, underlying11_.`firstsettlementdate` as firstse15_165_10_, underlying11_.`lastamount` as lastamount16_165_10_, underlying11_.`lastdate` as lastdate17_165_10_, underlying11_.`lasteventvalue` as lasteve18_165_10_, underlying11_.`marketderivedinfperiddration` as marketd19_165_10_, underlying11_.`marketderivedinfoperiodend` as marketd20_165_10_, underlying11_.`marketderivedinfoperiodstart` as marketd21_165_10_, underlying11_.`modifieddate` as modifie22_165_10_, underlying11_.`name` as name23_165_10_, underlying11_.`nextamount` as nextamount24_165_10_, underlying11_.`nexteventvalue` as nexteve25_165_10_, underlying11_.`numberholders` as numberh26_165_10_, underlying11_.`numberholdersdatetime` as numberh27_165_10_, underlying11_.`nmberholderspreviousdatetime` as nmberho28_165_10_, underlying11_.`objective` as objective29_165_10_, underlying11_.`penultimateamount` as penulti30_165_10_, underlying11_.`penultimatedate` as penulti31_165_10_, underlying11_.`principalpaymentend` as princip32_165_10_, underlying11_.`principalpaymentstart` as princip33_165_10_, underlying11_.`purchasingminimums` as purchas34_165_10_, underlying11_.`qualifiedplans` as qualifi35_165_10_, underlying11_.`recurrable` as recurrable36_165_10_, underlying11_.`shortname` as shortname37_165_10_, underlying11_.`instrumentdomain` as instrum38_165_10_, underlying11_.`issuerclass` as issuerc39_165_10_, underlying12_.`calculationtype` as calculat2_329_11_, underlying12_.`indicatorstype` as indicato3_329_11_, underlying12_.`marketcenter` as marketce4_329_11_, underlying12_.`quantitydescriptiontype` as quantity5_329_11_, underlying12_.`quantitytype` as quantity6_329_11_, underlying12_.`valuationref` as valuatio7_329_11_, underlying12_.`valuationtype` as valuatio8_329_11_, underlying12_.`unittype` as unittype9_329_11_, underlying12_.instrumentDomain as instrum10_329_11_, underlying12_.`datetime` as datetime11_329_11_, underlying12_.`previousdatetime` as previou12_329_11_, underlying12_.`rank` as rank13_329_11_, underlying12_.`underlyingcount` as underly14_329_11_, underlying12_.`unitsize` as unitsize15_329_11_, instrument1_.`name` as name2_168_12_, instrument1_.`instrumentstatustype` as instrume3_168_12_, instrument1_.`scopetype` as scopetype4_168_12_, instrument1_.`tranche` as tranche5_168_12_, instrument1_.`marketstatustype` as marketst6_168_12_, instrument1_.`markettype` as markettype7_168_12_, instrument1_.`segmenttype` as segmentt8_168_12_, instrument1_.`schemeinfo` as schemeinfo9_168_12_, instrument1_.`country` as country10_168_12_, instrument1_.`currency` as currency11_168_12_, instrument1_.`instrumentdomain` as instrum12_168_12_, instrument1_.`background` as background13_168_12_, instrument1_.`code` as code14_168_12_, instrument1_.`comment` as comment15_168_12_, instrument1_.`createdate` as createdate16_168_12_, instrument1_.`end` as end17_168_12_, instrument1_.`marketconditions` as marketc18_168_12_, instrument1_.`modifieddate` as modifie19_168_12_, instrument1_.`segmentidentifiercode` as segment20_168_12_, instrument1_.`start` as start21_168_12_, instrument1_.`issuancesubclass` as issuanc22_168_12_, instrument1_.`corporatechangesubclass` as corpora23_168_12_, issueamoun16_.`calculationtype` as calculat2_180_13_, issueamoun16_.`indicatorstype` as indicato3_180_13_, issueamoun16_.`marketcenter` as marketce4_180_13_, issueamoun16_.`quantitydescriptiontype` as quantity5_180_13_, issueamoun16_.`quantitytype` as quantity6_180_13_, issueamoun16_.`valuationtype` as valuatio7_180_13_, issueamoun16_.`currency` as currency8_180_13_, issueamoun16_.`debtindicatorstype` as debtindi9_180_13_, issueamoun16_.`crossrate` as crossrate10_180_13_, issueamoun16_.`crossratemultiplier` as crossra11_180_13_, issueamoun16_.`datetime` as datetime12_180_13_, issueamoun16_.`issueamount` as issueam13_180_13_, issueamoun16_.`multiplier` as multiplier14_180_13_, issueamoun16_.`previousdatetime` as previou15_180_13_, issueamoun16_.`rank` as rank16_180_13_, issueamoun16_.`size` as size17_180_13_, industryid6_.`industryidentifiertype` as industry2_162_14_, industryid6_.`code` as code3_162_14_, industryid6_.`end` as end4_162_14_, industryid6_.`name` as name5_162_14_, industryid6_.`start` as start6_162_14_, industryid6_.`validity` as validity7_162_14_, industryid6_.`instrumentdomain` as instrume8_162_14_, currency5_.`full` as full2_83_15_, currency5_.`scheme` as scheme3_83_15_, currency5_.`short` as short4_83_15_, issuedata9_.issuanceSubclass as issuance2_181_16_, issuedata9_.indexDomain as indexDom3_181_16_, issuedata9_.interestRateClass as interest4_181_16_, issuedata9_.foreignExchangeDomain as foreignE5_181_16_, issuedata9_.industrySpecificClass as industry6_181_16_, issuedata9_.economicClass as economic7_181_16_, issuedata9_.demographicClass as demograp8_181_16_, issuedata9_.`issuemarkettype` as issuemar9_181_16_, issuedata9_.`issuerref` as issuerref10_181_16_, issuedata9_.`liquidationstatustype` as liquida11_181_16_, issuedata9_.`offertype` as offertype12_181_16_, issuedata9_.`programtype` as program13_181_16_, issuedata9_.`votingrightstype` as votingr14_181_16_, issuedata9_.`accrualbasistype` as accrual15_181_16_, issuedata9_.`accrualconventiontype` as accrual16_181_16_, issuedata9_.`indicatorstype` as indicat17_181_16_, issuedata9_.`modificationtype` as modific18_181_16_, issuedata9_.`agreedrestriction` as agreedr19_181_16_, issuedata9_.`allowedindebtedness` as allowed20_181_16_, issuedata9_.`announcementdate` as announc21_181_16_, issuedata9_.`auctiondate` as auction22_181_16_, issuedata9_.`closingdate` as closing23_181_16_, issuedata9_.`createdate` as createdate24_181_16_, issuedata9_.`defaultclause` as default25_181_16_, issuedata9_.`facevalue` as facevalue26_181_16_, issuedata9_.`issuedate` as issuedate27_181_16_, issuedata9_.`marginable` as marginable28_181_16_, issuedata9_.`marginablemaxlimit` as margina29_181_16_, issuedata9_.`marginableminlimit` as margina30_181_16_, issuedata9_.`modificationdatetime` as modific31_181_16_, issuedata9_.`modifieddate` as modifie32_181_16_, issuedata9_.`negativepledge` as negativ33_181_16_, issuedata9_.`refrainfromacts` as refrain34_181_16_, issuedata9_.`settlementdate` as settlem35_181_16_, issuedata9_.`underlyingcount` as underly36_181_16_, issuedata9_.`useofproceeds` as useofpr37_181_16_, issuedata9_.`validity` as validity38_181_16_, locationty18_.`full` as full2_201_17_, locationty18_.`scheme` as scheme3_201_17_, locationty18_.`short` as short4_201_17_, marketstat15_.`industryidentifier` as industry2_208_18_, marketstat15_.`instrumentidentifier` as instrume3_208_18_, marketstat15_.issueData as issueData208_18_, location13_.`issuerclass` as issuerc19___, location13_.`id` as id1___ from `instrumentdomain` instrument0_ left outer join `instrumentidentifier` instrument1_ on instrument0_.`id`=instrument1_.`instrumentdomain` left outer join `schemeinfo` schemeinfo2_ on instrument1_.`schemeinfo`=schemeinfo2_.`id` left outer join `instrumenttype` instrument3_ on instrument0_.`instrumenttype`=instrument3_.`id` left outer join `denomination` denominati4_ on instrument0_.`id`=denominati4_.`instrumentdomain` left outer join `currency` currency5_ on denominati4_.`currency`=currency5_.`id` left outer join `industryidentifier` industryid6_ on instrument0_.`id`=industryid6_.`instrumentdomain` left outer join `lastcae` lastcae7_ on instrument0_.`id`=lastcae7_.`id` left outer join `issuerclass` issuerclas8_ on instrument0_.`issuerclass`=issuerclas8_.`id` left outer join `issuedata` issuedata9_ on instrument0_.`id`=issuedata9_.`id` left outer join `debtissuedata` debtissued10_ on instrument0_.`id`=debtissued10_.`id` left outer join `instrumentdomain` underlying11_ on instrument0_.`id`=underlying11_.`instrumentdomain` left outer join `underlyingcount` underlying12_ on instrument0_.`id`=underlying12_.instrumentDomain left outer join `location` location13_ on issuerclas8_.`id`=location13_.`issuerclass` left outer join `portfoliodomain` portfoliod14_ on issuedata9_.`id`=portfoliod14_.issueData left outer join `marketstatsclass` marketstat15_ on issuedata9_.`id`=marketstat15_.issueData left outer join `issueamount` issueamoun16_ on issuedata9_.`id`=issueamoun16_.`id` left outer join `country` country17_ on location13_.`country`=country17_.`id` left outer join `locationtype` locationty18_ on location13_.`locationtype`=locationty18_.`id` where (instrument3_.`id` in(46 , 48 , 49 , 150 , 151 , 185 , 432 , 438 , 439 , 443 , 473))and(instrument0_.`name` like ? )
2009-01-3015:12:17.437 GMT+0000 277797 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2009-01-3015:12:17.437 GMT+0000 277797 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.hibernate.SQL - select instrument0_.`id` as id1_165_0_, denominati4_.`id` as id1_101_1_, schemeinfo2_.`id` as id1_290_2_, location13_.`id` as id1_200_3_, lastcae7_.`id` as id1_196_4_, portfoliod14_.`id` as id1_245_5_, instrument3_.`id` as id1_171_6_, country17_.`id` as id1_77_7_, issuerclas8_.`id` as id1_191_8_, debtissued10_.`id` as id1_92_9_, underlying11_.`id` as id1_165_10_, underlying12_.`id` as id1_329_11_, instrument1_.`id` as id1_168_12_, issueamoun16_.`id` as id1_180_13_, industryid6_.`id` as id1_162_14_, currency5_.`id` as id1_83_15_, issuedata9_.`id` as id1_181_16_, locationty18_.`id` as id1_201_17_, marketstat15_.`id` as id1_208_18_, instrument0_.`instrumenttype` as instrume2_165_0_, instrument0_.`instrumentformtype` as instrume3_165_0_, instrument0_.`tradingrestrictionstype` as tradingr4_165_0_, instrument0_.`amountoutstanding` as amountou5_165_0_, instrument0_.`amountoutstandingdate` as amountou6_165_0_, instrument0_.`benchmarkstrategy` as benchmar7_165_0_, instrument0_.`contractvaluemultiplier` as contract8_165_0_, instrument0_.`createdate` as createdate9_165_0_, instrument0_.`defaultclause` as default10_165_0_, instrument0_.`firstamount` as firstam11_165_0_, instrument0_.`firstdate` as firstdate12_165_0_, instrument0_.`firstdealingdate` as firstde13_165_0_, instrument0_.`firsteventvalue` as firstev14_165_0_, instrument0_.`firstsettlementdate` as firstse15_165_0_, instrument0_.`lastamount` as lastamount16_165_0_, instrument0_.`lastdate` as lastdate17_165_0_, instrument0_.`lasteventvalue` as lasteve18_165_0_, instrument0_.`marketderivedinfperiddration` as marketd19_165_0_, instrument0_.`marketderivedinfoperiodend` as marketd20_165_0_, instrument0_.`marketderivedinfoperiodstart` as marketd21_165_0_, instrument0_.`modifieddate` as modifie22_165_0_, instrument0_.`name` as name23_165_0_, instrument0_.`nextamount` as nextamount24_165_0_, instrument0_.`nexteventvalue` as nexteve25_165_0_, instrument0_.`numberholders` as numberh26_165_0_, instrument0_.`numberholdersdatetime` as numberh27_165_0_, instrument0_.`nmberholderspreviousdatetime` as nmberho28_165_0_, instrument0_.`objective` as objective29_165_0_, instrument0_.`penultimateamount` as penulti30_165_0_, instrument0_.`penultimatedate` as penulti31_165_0_, instrument0_.`principalpaymentend` as princip32_165_0_, instrument0_.`principalpaymentstart` as princip33_165_0_, instrument0_.`purchasingminimums` as purchas34_165_0_, instrument0_.`qualifiedplans` as qualifi35_165_0_, instrument0_.`recurrable` as recurrable36_165_0_, instrument0_.`shortname` as shortname37_165_0_, instrument0_.`instrumentdomain` as instrum38_165_0_, instrument0_.`issuerclass` as issuerc39_165_0_, denominati4_.`calculationtype` as calculat2_101_1_, denominati4_.`indicatorstype` as indicato3_101_1_, denominati4_.`marketcenter` as marketce4_101_1_, denominati4_.`quantitydescirptiontype` as quantity5_101_1_, denominati4_.`quantitytype` as quantity6_101_1_, denominati4_.`valuationref` as valuatio7_101_1_, denominati4_.`valuationtype` as valuatio8_101_1_, denominati4_.`crossrate` as crossrate9_101_1_, denominati4_.`currency` as currency10_101_1_, denominati4_.`instrumentdomain` as instrum11_101_1_, denominati4_.`datetime` as datetime12_101_1_, denominati4_.`denomination` as denomin13_101_1_, denominati4_.`increment` as increment14_101_1_, denominati4_.`minval` as minval15_101_1_, denominati4_.`size` as size16_101_1_, denominati4_.`debtissuedata` as debtiss17_101_1_, schemeinfo2_.`displayname` as displayn2_290_2_, schemeinfo2_.`longname` as longname3_290_2_, schemeinfo2_.`scheme` as scheme4_290_2_, schemeinfo2_.`shortname` as shortname5_290_2_, location13_.`locationtype` as location2_200_3_, location13_.`country` as country3_200_3_, location13_.`address` as address4_200_3_, location13_.`city` as city5_200_3_, location13_.`end` as end6_200_3_, location13_.`faxnumber` as faxnumber7_200_3_, location13_.`municipality` as municipa8_200_3_, location13_.`postalcode` as postalcode9_200_3_, location13_.`postalcodescheme` as postalc10_200_3_, location13_.`regionname` as regionname11_200_3_, location13_.`start` as start12_200_3_, location13_.`stateorprovincename` as stateor13_200_3_, location13_.`telephonenumber` as telepho14_200_3_, location13_.`websiteurl` as websiteurl15_200_3_, location13_.`issuedata` as issuedata16_200_3_, location13_.`businessclass` as busines17_200_3_, location13_.`counterpartyclass` as counter18_200_3_, location13_.`issuerclass` as issuerc19_200_3_, lastcae7_.`caetype` as caetype2_196_4_, lastcae7_.`datetime` as datetime3_196_4_, portfoliod14_.`industryidentifier` as industry2_245_5_, portfoliod14_.`underlying` as underlying3_245_5_, portfoliod14_.`underlyingcount` as underlyi4_245_5_, portfoliod14_.issueData as issueData245_5_, instrument3_.`full` as full2_171_6_, instrument3_.`scheme` as scheme3_171_6_, instrument3_.`short` as short4_171_6_, country17_.`country` as country2_77_7_, country17_.`scheme` as scheme3_77_7_, issuerclas8_.`entitystatustype` as entityst2_191_8_, issuerclas8_.`replacemententity` as replacem3_191_8_, issuerclas8_.`replacementtype` as replacem4_191_8_, issuerclas8_.`comment` as comment5_191_8_, issuerclas8_.`createdate` as createdate6_191_8_, issuerclas8_.`creationdate` as creation7_191_8_, issuerclas8_.`duration` as duration8_191_8_, issuerclas8_.`end` as end9_191_8_, issuerclas8_.`incorpdate` as incorpdate10_191_8_, issuerclas8_.`modifieddate` as modifie11_191_8_, issuerclas8_.`name` as name12_191_8_, issuerclas8_.`parentid` as parentid13_191_8_, issuerclas8_.`reviewdate` as reviewdate14_191_8_, issuerclas8_.`shortname` as shortname15_191_8_, issuerclas8_.`start` as start16_191_8_, issuerclas8_.`ultimateparentid` as ultimat17_191_8_, debtissued10_.convertible as converti2_92_9_, debtissued10_.`debtindicatorstype` as debtindi3_92_9_, debtissued10_.`striptype` as striptype4_92_9_, debtissued10_.`strippbleinstrmentidentifier` as strippbl5_92_9_, debtissued10_.`coupontype` as coupontype6_92_9_, debtissued10_.`createdate` as createdate7_92_9_, debtissued10_.`modifieddate` as modified8_92_9_, debtissued10_.`overallotment` as overallo9_92_9_, debtissued10_.`strippable` as strippable10_92_9_, debtissued10_.`subscriptionduration` as subscri11_92_9_, debtissued10_.`subscriptionend` as subscri12_92_9_, debtissued10_.`subscriptionminval` as subscri13_92_9_, debtissued10_.`subscriptionstart` as subscri14_92_9_, underlying11_.`instrumenttype` as instrume2_165_10_, underlying11_.`instrumentformtype` as instrume3_165_10_, underlying11_.`tradingrestrictionstype` as tradingr4_165_10_, underlying11_.`amountoutstanding` as amountou5_165_10_, underlying11_.`amountoutstandingdate` as amountou6_165_10_, underlying11_.`benchmarkstrategy` as benchmar7_165_10_, underlying11_.`contractvaluemultiplier` as contract8_165_10_, underlying11_.`createdate` as createdate9_165_10_, underlying11_.`defaultclause` as default10_165_10_, underlying11_.`firstamount` as firstam11_165_10_, underlying11_.`firstdate` as firstdate12_165_10_, underlying11_.`firstdealingdate` as firstde13_165_10_, underlying11_.`firsteventvalue` as firstev14_165_10_, underlying11_.`firstsettlementdate` as firstse15_165_10_, underlying11_.`lastamount` as lastamount16_165_10_, underlying11_.`lastdate` as lastdate17_165_10_, underlying11_.`lasteventvalue` as lasteve18_165_10_, underlying11_.`marketderivedinfperiddration` as marketd19_165_10_, underlying11_.`marketderivedinfoperiodend` as marketd20_165_10_, underlying11_.`marketderivedinfoperiodstart` as marketd21_165_10_, underlying11_.`modifieddate` as modifie22_165_10_, underlying11_.`name` as name23_165_10_, underlying11_.`nextamount` as nextamount24_165_10_, underlying11_.`nexteventvalue` as nexteve25_165_10_, underlying11_.`numberholders` as numberh26_165_10_, underlying11_.`numberholdersdatetime` as numberh27_165_10_, underlying11_.`nmberholderspreviousdatetime` as nmberho28_165_10_, underlying11_.`objective` as objective29_165_10_, underlying11_.`penultimateamount` as penulti30_165_10_, underlying11_.`penultimatedate` as penulti31_165_10_, underlying11_.`principalpaymentend` as princip32_165_10_, underlying11_.`principalpaymentstart` as princip33_165_10_, underlying11_.`purchasingminimums` as purchas34_165_10_, underlying11_.`qualifiedplans` as qualifi35_165_10_, underlying11_.`recurrable` as recurrable36_165_10_, underlying11_.`shortname` as shortname37_165_10_, underlying11_.`instrumentdomain` as instrum38_165_10_, underlying11_.`issuerclass` as issuerc39_165_10_, underlying12_.`calculationtype` as calculat2_329_11_, underlying12_.`indicatorstype` as indicato3_329_11_, underlying12_.`marketcenter` as marketce4_329_11_, underlying12_.`quantitydescriptiontype` as quantity5_329_11_, underlying12_.`quantitytype` as quantity6_329_11_, underlying12_.`valuationref` as valuatio7_329_11_, underlying12_.`valuationtype` as valuatio8_329_11_, underlying12_.`unittype` as unittype9_329_11_, underlying12_.instrumentDomain as instrum10_329_11_, underlying12_.`datetime` as datetime11_329_11_, underlying12_.`previousdatetime` as previou12_329_11_, underlying12_.`rank` as rank13_329_11_, underlying12_.`underlyingcount` as underly14_329_11_, underlying12_.`unitsize` as unitsize15_329_11_, instrument1_.`name` as name2_168_12_, instrument1_.`instrumentstatustype` as instrume3_168_12_, instrument1_.`scopetype` as scopetype4_168_12_, instrument1_.`tranche` as tranche5_168_12_, instrument1_.`marketstatustype` as marketst6_168_12_, instrument1_.`markettype` as markettype7_168_12_, instrument1_.`segmenttype` as segmentt8_168_12_, instrument1_.`schemeinfo` as schemeinfo9_168_12_, instrument1_.`country` as country10_168_12_, instrument1_.`currency` as currency11_168_12_, instrument1_.`instrumentdomain` as instrum12_168_12_, instrument1_.`background` as background13_168_12_, instrument1_.`code` as code14_168_12_, instrument1_.`comment` as comment15_168_12_, instrument1_.`createdate` as createdate16_168_12_, instrument1_.`end` as end17_168_12_, instrument1_.`marketconditions` as marketc18_168_12_, instrument1_.`modifieddate` as modifie19_168_12_, instrument1_.`segmentidentifiercode` as segment20_168_12_, instrument1_.`start` as start21_168_12_, instrument1_.`issuancesubclass` as issuanc22_168_12_, instrument1_.`corporatechangesubclass` as corpora23_168_12_, issueamoun16_.`calculationtype` as calculat2_180_13_, issueamoun16_.`indicatorstype` as indicato3_180_13_, issueamoun16_.`marketcenter` as marketce4_180_13_, issueamoun16_.`quantitydescriptiontype` as quantity5_180_13_, issueamoun16_.`quantitytype` as quantity6_180_13_, issueamoun16_.`valuationtype` as valuatio7_180_13_, issueamoun16_.`currency` as currency8_180_13_, issueamoun16_.`debtindicatorstype` as debtindi9_180_13_, issueamoun16_.`crossrate` as crossrate10_180_13_, issueamoun16_.`crossratemultiplier` as crossra11_180_13_, issueamoun16_.`datetime` as datetime12_180_13_, issueamoun16_.`issueamount` as issueam13_180_13_, issueamoun16_.`multiplier` as multiplier14_180_13_, issueamoun16_.`previousdatetime` as previou15_180_13_, issueamoun16_.`rank` as rank16_180_13_, issueamoun16_.`size` as size17_180_13_, industryid6_.`industryidentifiertype` as industry2_162_14_, industryid6_.`code` as code3_162_14_, industryid6_.`end` as end4_162_14_, industryid6_.`name` as name5_162_14_, industryid6_.`start` as start6_162_14_, industryid6_.`validity` as validity7_162_14_, industryid6_.`instrumentdomain` as instrume8_162_14_, currency5_.`full` as full2_83_15_, currency5_.`scheme` as scheme3_83_15_, currency5_.`short` as short4_83_15_, issuedata9_.issuanceSubclass as issuance2_181_16_, issuedata9_.indexDomain as indexDom3_181_16_, issuedata9_.interestRateClass as interest4_181_16_, issuedata9_.foreignExchangeDomain as foreignE5_181_16_, issuedata9_.industrySpecificClass as industry6_181_16_, issuedata9_.economicClass as economic7_181_16_, issuedata9_.demographicClass as demograp8_181_16_, issuedata9_.`issuemarkettype` as issuemar9_181_16_, issuedata9_.`issuerref` as issuerref10_181_16_, issuedata9_.`liquidationstatustype` as liquida11_181_16_, issuedata9_.`offertype` as offertype12_181_16_, issuedata9_.`programtype` as program13_181_16_, issuedata9_.`votingrightstype` as votingr14_181_16_, issuedata9_.`accrualbasistype` as accrual15_181_16_, issuedata9_.`accrualconventiontype` as accrual16_181_16_, issuedata9_.`indicatorstype` as indicat17_181_16_, issuedata9_.`modificationtype` as modific18_181_16_, issuedata9_.`agreedrestriction` as agreedr19_181_16_, issuedata9_.`allowedindebtedness` as allowed20_181_16_, issuedata9_.`announcementdate` as announc21_181_16_, issuedata9_.`auctiondate` as auction22_181_16_, issuedata9_.`closingdate` as closing23_181_16_, issuedata9_.`createdate` as createdate24_181_16_, issuedata9_.`defaultclause` as default25_181_16_, issuedata9_.`facevalue` as facevalue26_181_16_, issuedata9_.`issuedate` as issuedate27_181_16_, issuedata9_.`marginable` as marginable28_181_16_, issuedata9_.`marginablemaxlimit` as margina29_181_16_, issuedata9_.`marginableminlimit` as margina30_181_16_, issuedata9_.`modificationdatetime` as modific31_181_16_, issuedata9_.`modifieddate` as modifie32_181_16_, issuedata9_.`negativepledge` as negativ33_181_16_, issuedata9_.`refrainfromacts` as refrain34_181_16_, issuedata9_.`settlementdate` as settlem35_181_16_, issuedata9_.`underlyingcount` as underly36_181_16_, issuedata9_.`useofproceeds` as useofpr37_181_16_, issuedata9_.`validity` as validity38_181_16_, locationty18_.`full` as full2_201_17_, locationty18_.`scheme` as scheme3_201_17_, locationty18_.`short` as short4_201_17_, marketstat15_.`industryidentifier` as industry2_208_18_, marketstat15_.`instrumentidentifier` as instrume3_208_18_, marketstat15_.issueData as issueData208_18_, location13_.`issuerclass` as issuerc19___, location13_.`id` as id1___ from `instrumentdomain` instrument0_ left outer join `instrumentidentifier` instrument1_ on instrument0_.`id`=instrument1_.`instrumentdomain` left outer join `schemeinfo` schemeinfo2_ on instrument1_.`schemeinfo`=schemeinfo2_.`id` left outer join `instrumenttype` instrument3_ on instrument0_.`instrumenttype`=instrument3_.`id` left outer join `denomination` denominati4_ on instrument0_.`id`=denominati4_.`instrumentdomain` left outer join `currency` currency5_ on denominati4_.`currency`=currency5_.`id` left outer join `industryidentifier` industryid6_ on instrument0_.`id`=industryid6_.`instrumentdomain` left outer join `lastcae` lastcae7_ on instrument0_.`id`=lastcae7_.`id` left outer join `issuerclass` issuerclas8_ on instrument0_.`issuerclass`=issuerclas8_.`id` left outer join `issuedata` issuedata9_ on instrument0_.`id`=issuedata9_.`id` left outer join `debtissuedata` debtissued10_ on instrument0_.`id`=debtissued10_.`id` left outer join `instrumentdomain` underlying11_ on instrument0_.`id`=underlying11_.`instrumentdomain` left outer join `underlyingcount` underlying12_ on instrument0_.`id`=underlying12_.instrumentDomain left outer join `location` location13_ on issuerclas8_.`id`=location13_.`issuerclass` left outer join `portfoliodomain` portfoliod14_ on issuedata9_.`id`=portfoliod14_.issueData left outer join `marketstatsclass` marketstat15_ on issuedata9_.`id`=marketstat15_.issueData left outer join `issueamount` issueamoun16_ on issuedata9_.`id`=issueamoun16_.`id` left outer join `country` country17_ on location13_.`country`=country17_.`id` left outer join `locationtype` locationty18_ on location13_.`locationtype`=locationty18_.`id` where (instrument3_.`id` in(46 , 48 , 49 , 150 , 151 , 185 , 432 , 438 , 439 , 443 , 473))and(instrument0_.`name` like ? )
2009-01-3015:12:17.609 GMT+0000 277969 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open ResultSet (open ResultSets: 0, globally: 0)
2009-01-3015:12:17.687 GMT+0000 278047 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.hibernate.loader.Loader - result row: EntityKey[InstrumentDomain#594], null, null, null, null, null, EntityKey[InstrumentType#46], null, null, null, null, null, EntityKey[InstrumentIdentifier#1239], null, null, null, EntityKey[IssueData#594], null, null
2009-01-3015:12:17.687 GMT+0000 278047 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierCacheHandler - Setting id: 594 for object com.stpenable.gensec.impl.InstrumentDomainImpl in idcache
2009-01-3015:12:17.687 GMT+0000 278047 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.eclipse.emf.teneo.hibernate.mapping.property.EAttributePropertyHandler - Expecting int as instance class but it is: java.lang.Integer
2009-01-3015:12:17.687 GMT+0000 278047 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierCacheHandler - Setting id: 46 for object com.stpenable.gensec.impl.InstrumentTypeImpl in idcache
2009-01-3015:12:17.687 GMT+0000 278047 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.eclipse.emf.teneo.hibernate.mapping.property.EAttributePropertyHandler - Expecting int as instance class but it is: java.lang.Integer
2009-01-3015:12:17.687 GMT+0000 278047 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierCacheHandler - Setting id: 1239 for object com.stpenable.gensec.impl.InstrumentIdentifierImpl in idcache
2009-01-3015:12:17.687 GMT+0000 278047 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.eclipse.emf.teneo.hibernate.mapping.property.EAttributePropertyHandler - Expecting int as instance class but it is: java.lang.Integer
2009-01-3015:12:17.687 GMT+0000 278047 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierCacheHandler - Setting id: 594 for object com.stpenable.gensec.impl.IssueDataImpl in idcache
2009-01-3015:12:17.687 GMT+0000 278047 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.eclipse.emf.teneo.hibernate.mapping.property.EAttributePropertyHandler - Expecting int as instance class but it is: java.lang.Integer
2009-01-3015:12:17.703 GMT+0000 278063 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close ResultSet (open ResultSets: 1, globally: 1)
2009-01-3015:12:17.703 GMT+0000 278063 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2009-01-3015:15:38.531 GMT+0000 478891 [btpool0-3 - /dwr/dwr/call/plaincall/SearchEquity.searchEquity.dwr] ERROR com.stpware.secm.dwr.SearchEquity - Hibernate error:
org.hibernate.HibernateException: Unable to resolve property: issueData
If I remove this "left join fetch issd.issueAmount issamt" out of the above HQL it works?
I am not able to get reasonable performance out of Hibernate for my large complex model.
By changing all the HQL to instead use session.createSQLQuery I should be able to control everything I need. A shame that HQL and lazy loading do not do it for me.
If there are caveats to how lazy loading and the HQL are applied I have not found them in the documentation, or there is something about my model that forces the behaviour that is different than documented.
Thx.
David