How to use `setResultTransformer` after Hibernate 5.2?

Hibernate 6 has not been released yet. However, based on this issue ResultTransformer interface was split into the 2 functional interfaces: TupleTransformer and ResultListTransformer.


The ResultTransformer comes with a legacy definition which is not following the Functional Interface syntax. Hence, we cannot use a lambda in this example. Hibernate 6.0 aims to overcome this issue, so that’s why the Hibernate ORM 5.2 ResultTransformer is deprecated. Nevertheless, an alternative will be provided, so the concept we are discussing in this article is going to stand still even in Hibernate 6.

https://vladmihalcea.com/why-you-should-use-the-hibernate-resulttransformer-to-customize-result-set-mappings/

Tags:

Java

Hibernate