Criteria: Why can't projections include TypedValues? Workaround?


I was trying to build a Projection for a custom function I need when I noticed that the contract for Projection doesn’t include the ability to return TypedValue’s. This is a problem because one of the arguments to the function is supplied by the user. I am wondering why this is the case and whether there is a workaround.

Thank You in advance!

The Hibernate Criteria is deprecated and it might be removed in a future version of Hibernate. No development is done for it, so you should switch to JPA Criteria API which supports type-safe queries.