Argh… of course it is HQL. I was mislead by the fact that event registering a custom count function, somehow the query is still rendered with the default implementation. I need to investigate on that, I suspect I'm missing something, somewhere.