| See the test case for details, but basically, I was trying to create a HQL query that would return a parent object if either its sub-objects matched on a name, or it had no links to its sub-objects. I mistakenly used the identification variable in an is empty instead of the actual collection because I misunderstood that the identification variable is the single object in the collection, not an alias for the collection itself. Whilst this is not the bug, what I believe is the bug, is that hibernate went on to create a query something like this: https://pastebin.com/Qz9eFcjz Instead of just erroring or at least throwing a warning saying that I was using invalid syntax. Maybe this will not be agreed with, but I feel like what was happening was very unexpected to the user, and this situation would be greatly improved if hibernate could detect whether someone was using a non collection or collection identification variable in an is [not] empty fragment (or indeed any other collection-related fragments). |