Deprecation of Hibernate Criteria and how we can still prevent it

Well, i suppose that i missunderstood subselect mappings, with your example it is more clear to me that how hibernate works. Thanks for this.

Now i only have to deal with the query as an annotation, add server-only dependency (to my perspective) to the common jar project for compilation only and get used to manage the query in the class not in the xml, but if that’s the way it is, i have to change my mind.

I think real problem for us is that we used to code in some way and then we have to change it, nobody like changes when the thing is working. Moreover when the change forces us to work in a manner we dont like. And yes there are a lot of tools out there, but our projects are in hibernate and it is less cost work with this changes than change the tool.

I only hope jpa spec designers evolve it to a fluent api, the code is prettier and clean, with current jpa criteria i have to define a lot of typed-vars wich results in many runtime errors.

Thanks for your time and patinent.