[hibernate-issues] [Hibernate-JIRA] Created: (HHH-7189) AliasToBeanResultTransformer: query accesses fields of another class.

Orlando Becerra (JIRA) noreply at atlassian.com
Mon Mar 19 16:23:48 EDT 2012


AliasToBeanResultTransformer: query accesses fields of another class.
---------------------------------------------------------------------

                 Key: HHH-7189
                 URL: https://hibernate.onjira.com/browse/HHH-7189
             Project: Hibernate ORM
          Issue Type: New Feature
          Components: query-hql
         Environment: All
            Reporter: Orlando Becerra
            Priority: Critical


The problem arises when you want to transform the query result to an object when the query accesses fields of another class.

Sample:

        List<Employee> list =
            s.createQuery(""
            + "SELECT E.name as name, E.deparment.name as deparment_name "
            + "FROM "
            + Employee.class.getName()).
            setResultTransformer(new AliasToBeanResultTransformer(Employee.class)).
            list();

Where the departmet is a field of Employee class and we only want retrieve the department's name.

att:
Oracle Certified Master Java Developers: Orlando Becerra, Luis Gonzalez and Nelson Moncada.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list