Danilo created Bug HHH-7641
Issue Type: Bug Bug
Affects Versions: 4.1.7
Assignee: Unassigned
Created: 25/Sep/12 11:25 AM
Description:
  • Create a new Transformer class
  • attach it to an Query or Critiera
  • The Query will delivery a fully filled entity
  • The Criteria not
  • Tested also with Criteria.ALIAS_TO_ENTITY_MAP with the same results

Example-Code:

List objects = getSession().createCriteria(MyEntity.class)
.setResultTransformer(new MyTransformer())
.list();

List objects = getSession().createQuery("from MyEntity"))
.setResultTransformer(new MyTransformer())
.list();

public class MyTransformer implements ResultTransformer {

public Object transformTuple(Object[] rowData, String[] aliasNames) { // only id is populated in rowData[0] when executed via criteria }

public List transformList(List list) { return list; }
}

Source: http://stackoverflow.com/questions/9913691/3-6-8-criteria-resulttransformer-is-not-populating-tuple-data

Environment: Postgresql 9.2 (postgresql-9.1-902.jdbc4.jar)
Hibernate 4.1.7
Project: Hibernate ORM
Labels: hibernate resultTransformer
Priority: Major Major
Reporter: Danilo
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