• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate 2: How I write a query that specified that a collection in an object is empty or null?

 
John Landon
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have Box. Box has collection of Items. I want to write a query that gets all Boxes with no items.
I could just get all boxes and go through all of them to check if they have no items but is there a better way?
Here are the mappings.

in Item:


in Box:


Thanks,
John
 
If you are using a rototiller, you are doing it wrong. Even on this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!