Custom ResultTransformer for JPA criteria queries

Description

The following JPA criteria query assigns aliases in the projection list:

These aliases are not available/preserved in the generated query string:

The aliases are also not available in any of the alias-based ResultTransformers. You currently can't apply AliasToBeanResultTransformer to a JPA criteria query.

I've had a look at CriteriaQueryTransformer and it might not be easy to support custom transformers for JPA criteria queries. If this isn't supported, it should probably be documented.

Activity

Show:

Christian Bauer April 21, 2013 at 6:25 AM

Minor bug in CompoundSelectionImpl.java:

The return is wrong, it should be "return foundHandlers ? valueHandlers : null;"

It doesn't have any consequences right now because CriteriaQueryTransformer treats an empty array of ValueHandler the same as a null.

Details

Assignee

Reporter

Priority

Created April 21, 2013 at 6:13 AM
Updated April 12, 2019 at 11:54 AM