Hi,
I am currently trying to migrate a system with Hibernate persistence layer to JPA.
With Hibernate it is possible to transform result set of native or custom queries to particular non-managed value object, thus skipping boilerplate conversion and multiple setter invocations:
sqlQuery.setResultTransformer(Transformers.aliasToBean(SomeSimpleDTO.class));
The question is, how it is possible to do something similar with JPA?
I know that it is possible to use SqlResultSetMapping annotation to map particular aliases with particular properties, however, I have read that this annotation works only with managed entities, but not with non-managed DTOs. Is this true? If yes, does JPA have similar functionality?
Thank you.