Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-4175 HHH-5163 Bug when applying a ResultTransformer on a cacheable projection based criteria
  3. JBPAPP-5481

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

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Major Major
    • EAP_EWP 5.1.1
    • None
    • Hibernate
    • None
    • Hide
      When Hibernate executed a cacheable query using a <classname>ResultTransformer</classname>, it attempted to cache the results. However, the data had the potential to be modified so that Hibernate could not read it.

      PropertyAccessException was thrown when all of the following are true:

      * The query has a ResultTransformer
      * Results are cached before being transformed
      * Each result has a single value

      This issue is fixed by introducing three new API calls:
      org.hibernate.transform.AliasedTupleSubsetResultTransformer
      org.hibernate.transform.CacheableResultTransformer
      org.hibernate.transform.TupleSubsetResultTransformer.

      Refer to the Hibernate Javadoc for more details.
      Show
      When Hibernate executed a cacheable query using a <classname>ResultTransformer</classname>, it attempted to cache the results. However, the data had the potential to be modified so that Hibernate could not read it. PropertyAccessException was thrown when all of the following are true: * The query has a ResultTransformer * Results are cached before being transformed * Each result has a single value This issue is fixed by introducing three new API calls: org.hibernate.transform.AliasedTupleSubsetResultTransformer org.hibernate.transform.CacheableResultTransformer org.hibernate.transform.TupleSubsetResultTransformer. Refer to the Hibernate Javadoc for more details.
    • Documented as Resolved Issue

      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 ) );

            shaozliu Strong Liu(刘少壮) (Inactive)
            shaozliu Strong Liu(刘少壮) (Inactive)
            Misty Stanley-Jones Misty Stanley-Jones (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: