| Hi Christian, thanks for your Feedback. Actually I was not aware of the fact that the JPA Spec does not allow to apply arithmetic functions on a join alias.
What should be the semantics of size(joinAlias)? Should it add a group by for you when none exists? If so which?
No group by should be added, this must already be part of the query. Of course my example is not taken from the real world application, it was just the smallest possible example demonstrating the presumably bug. Funny enough, I also ended up with the COUNT()-solution during my elaboration yesterday. Nevertheless, something that worked with 4.3.11 doesn't work with 5.2.2 anymore, without any obvious or documented reason. It would be good if someone from the Hibernate team could comment on this, whether
- this issue is caused by an non-spec conformant use of the JQL -> the query parser should throw an error, as you suggested
- although non-spec conformant, this issue should be fixed in order to preserve the backwards compatibility to 4.x
Regards Matthias |