• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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???


 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic