• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

Leftouter join in Hibernate2.0

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

we are facing issues in executing the HQL query with LeftOuterjoin fetch , while exceuting the query it is appending the leftouter join conditions for the properties which exists with OR condition in the where clause, at this moment it is throwing an Exception saying that 'ORA-01719: outer join operator (+) not allowed in operand of OR or IN'.

The query should look like this:

FROM DDR_TARGETED_DRG_LIST ddrtargete0_,
DRG drgvalue1_, CODE codevalue2_, DRG drgvalue3_,
CODE codevalue4_, DRG drgvalue5_, CODE codevalue6_

WHERE ddrtargete0_.PRIMARY_DRG_ID=drgvalue1_.DRG_ID(+) AND ddrtargete0_.PRIMARY_DRG_ID=drgvalue1_.DRG_ID(+) AND drgvalue1_.MDC_CODE_ID=codevalue2_.CODE_ID(+) AND ddrtargete0_.DRG2_ID=drgvalue3_.DRG_ID(+) AND ddrtargete0_.DRG2_ID=drgvalue3_.DRG_ID(+) AND drgvalue3_.MDC_CODE_ID=codevalue4_.CODE_ID(+) AND ddrtargete0_.DRG3_ID=drgvalue5_.DRG_ID(+) AND ddrtargete0_.DRG3_ID=drgvalue5_.DRG_ID(+) AND drgvalue5_.MDC_CODE_ID=codevalue6_.CODE_ID(+) AND (drgvalue1_.DRG_CODE =014 or drgvalue3_.DRG_CODE =014 or drgvalue5_.DRG_CODE =014) AND 1=1 ORDER BY DRG_CODE

but in Hibernate , when we add a Criteria with 'LeftOuterjoin' , it is generating the query as below:

Select * from DDR_TARGETED_DRG_LIST ddrtargete0_, DRG drgvalue1_, CODE codevalue2_, DRG drgvalue3_, CODE codevalue4_, DRG drgvalue5_, CODE codevalue6_ where ddrtargete0_.PRIMARY_DRG_ID=drgvalue1_.DRG_ID(+) and ddrtargete0_.PRIMARY_DRG_ID=drgvalue1_.DRG_ID(+) and drgvalue1_.MDC_CODE_ID=codevalue2_.CODE_ID(+) and ddrtargete0_.DRG2_ID=drgvalue3_.DRG_ID(+) and ddrtargete0_.DRG2_ID=drgvalue3_.DRG_ID(+) and drgvalue3_.MDC_CODE_ID=codevalue4_.CODE_ID(+) and ddrtargete0_.DRG3_ID=drgvalue5_.DRG_ID(+) and ddrtargete0_.DRG3_ID=drgvalue5_.DRG_ID(+) and drgvalue5_.MDC_CODE_ID=codevalue6_.CODE_ID(+) and ((drgvalue1_.DRG_CODE=? and <i>ddrtargete0_.PRIMARY_DRG_ID=drgvalue1_.DRG_ID(+)</i> OR(drgvalue3_.DRG_CODE=? and <i>ddrtargete0_.DRG2_ID=drgvalue3_.DRG_ID(+)</i> OR(drgvalue5_.DRG_CODE=? <i>and ddrtargete0_.DRG3_ID=drgvalue5_.DRG_ID(+)</i> AND(1=1 )) order by ddrtargete0_.DDR_TARGETED_DRG_LIST_ID ASC

please let me know , how to avoid appending this leftouter join condition in the where clause with each property having OR condition.

thanks in advance.
 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you share the actual code you've written to generate this query?
 
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!