Hibernate question/Classes that contains a Collection



Hi-

I have two hibernate classes, with a many to one relationship existing
between them. The first class, Task, contains a set of Listener
objects.

I am able to save Task objects and have the set of Listeners also save
properly. Am wondering how to do a query for only Task objects that
have a non-empty Listener set. I used the Restrictions.isNotEmpty()
on the listener property, but it seems to be returning all of the Task
objects, instead of just Task objects where the collection isn't
empty.

Are there any gotchas I should look out for?

Thanks

.