Hibernate ResultTransformer is @Deprecated. What to use instead?


#1

I use query.setResultTransformer(**), but this method is titled Deprecated.

Which method replaced setResultTransformer?


#2

For the moment, there is no replacement.

In 6.0, the ResultTransformer will be replaced by a @FunctionalInterface, but the underlying mechanism of transforming the Object[] property values will probably be the same.

Therefore, you can use it as-is and, only if you upgrade to 6.0, you will have to think about replacing it with the new variant.


#3

Hi Vlad,

Please, advice if nothing changed recently. We are using deprecated setResultTransformer now and just wondering if mechanism in new @FunctionalInterface would be the same so we can just wait or we have to think about other approach right now since we plan upgrade to Hibernate 6.0 in the future.

Thank you in advance.


#4

Nothing has changed because the current version is 5.3.