These aliases are not available/preserved in the generated query string:
Query query = em.createQuery(criteria);
org.hibernate.Query hibernateQuery = ((HibernateQuery)query).getHibernateQuery();
assertEquals(
hibernateQuery.getQueryString(),
"select i.id as itemId, i.name as name, i.auctionEnd as auctionEnd from Item as i"
);
// Actual: select i.id, i.name, i.auctionEnd from Item as i
assertEquals(
hibernateQuery.getReturnAliases(),
newString[] {"itemId", "name", "auctionEnd"}
);
// Actual: 0, 1, 2
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.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira