[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-4999) createSQLQuery(query).list() result screw up when when columns in different tables have same name

Gail Badner (JIRA) noreply at atlassian.com
Tue Jan 18 13:56:05 EST 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4999?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner updated HHH-4999:
-----------------------------

    Fix Version/s:     (was: 3.6.1)
                   4.0.0.Alpha2
                   3.6.next

> createSQLQuery(query).list() result screw up when when columns in different tables have same name
> -------------------------------------------------------------------------------------------------
>
>                 Key: HHH-4999
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4999
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: query-sql
>    Affects Versions: 3.5.0-CR-2, 3.5.1
>         Environment: hibernate-core 3.5.0-CR-2 
> MySQL 5
>            Reporter: thogau
>             Fix For: 3.6.next, 4.0.0.Alpha2
>
>         Attachments: joinProblem.zip
>
>
> The same SQL query doesn't retrieve the same results with hibernate and SQL client :
> {{SELECT groupe.name, center.name, roles.displayname, users.username, CASE WHEN center.id = 2 THEN 1 ELSE 0 END AS showlast
> FROM groupe, center, users, roles WHERE users.role_id = roles.id AND users.center_id = center.id
> AND center.group_id = groupe.id ORDER BY showlast, groupe.sitecoordinateur DESC, groupe.name, center.headcenter DESC, center.name, roles.id}}
> When performed with hibernate, *group.name* is retrieved twice (*center.name* is always the same as *group.name*).
> Still, it is possible to retrieve the correct value for *center.name* using *CONCAT('', center.name)*
> A small eclipse + maven projet with unit test is attached. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list