• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Problem with OUTER JOIN hibernate

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have two classes - abbreviated for clarity.

1:
2:

There are 5 different categories in the categories table and I'm trying to use an outer join to get me the number of times each category occurs in the progress table; e.g.
Error Category A 16839
Error Category B 22871
Error Category C 10
Invalid Entity 6706
No Error 201186

This query is working fine..


EXCEPT that if there are no occurences of a Category in the Progress table
I would like to see Error Category C 0 for example. The trouble is that in such a case the output is:
Error Category A 16839
Error Category B 22871
Invalid Entity 6706
No Error 201186

i.e no count for Error Category C 0.
In good ol' SQL the outer join works fine, but HQL doesn't seem to return null rows. Is this just a feature of HQL or am I doing something wrong???


 
What's gotten into you? Could it be this tiny ad?
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic