PropertyAccessException when caching results from a Query with a ResultTransformer that as 1 value per row

Description

PropertyAccessException is thrown when all of the following are true:

  • Query has a ResultTransformer

  • results are cached before being transformed

  • each result has a single value

This is reproduced by:

  • HqlQueryCachePutResultTransformerTest.testOneSelectNewListFailureExpected(), which has:
    s.createQuery( "select new org.hibernate.test.querycache.StudentDTO(s.name) from Student s order by st.studentNumber" );

  • HqlQueryCachePutResultTransformerTesttestAliasToBeanDtoOneArgListFailureExpected(), which has:
    s.createQuery( "select st.name as studentName from Student st order by st.studentNumber" )
    .setResultTransformer( Transformers.aliasToBean( StudentDTO.class ) );

Environment

None

Activity

Show:
Gail Badner
July 30, 2010, 3:41 PM

Fixed in trunk and Branch_3_5.

Steve Ebersole
March 22, 2011, 6:09 AM

Bulk closing stale resolved issues

Fixed

Assignee

Gail Badner

Reporter

Gail Badner

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major