[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-1969) Table aliases constructed incorrectly from HQL when JOIN is used when selecting multiple objects
Steve Ebersole (JIRA)
noreply at atlassian.com
Fri Oct 31 00:39:04 EDT 2008
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steve Ebersole closed HHH-1969.
-------------------------------
Resolution: Duplicate
> Table aliases constructed incorrectly from HQL when JOIN is used when selecting multiple objects
> ------------------------------------------------------------------------------------------------
>
> Key: HHH-1969
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1969
> Project: Hibernate Core
> Issue Type: Bug
> Components: query-hql
> Affects Versions: 3.2.0.cr3
> Environment: MS SQL Server 2000, JDK1.5, Hibernate 3.2cr3
> Reporter: Ryan Norris
> Priority: Critical
>
> When constructing a query to retrieve a "cross" join (cartesian product) of multiple objects and a JOIN is used, the table aliases for the cartesian objects are misplaced during query translation:
> Example:
> SELECT
> p, c, u
> FROM
> Practice p,
> Publication c,
> UserGroup u
> JOIN
> p.locations AS l
> WITH l.practice = p
> Results in a translated SQL query of:
> select
> practice0_.practice_id as practice1_54_0_,
> publicatio1_.publication_id as publicat1_56_1_,
> usergroup2_.usergroup_id as usergroup1_59_2_,
> practice0_.brand_id as brand4_54_0_,
> practice0_.practice_nm as practice2_54_0_,
> practice0_.active_flg as active3_54_0_,
> publicatio1_.admin_flg as admin2_56_1_,
> publicatio1_.practice_id as practice6_56_1_,
> publicatio1_.usergroup_id as usergroup7_56_1_,
> publicatio1_.inbox_user_id as inbox8_56_1_,
> publicatio1_.publication_nm as publicat3_56_1_,
> publicatio1_.location_id as location9_56_1_,
> publicatio1_.visible_flg as visible4_56_1_,
> publicatio1_.active_flg as active5_56_1_,
> usergroup2_.usergroup_nm as usergroup2_59_2_,
> usergroup2_.icon as icon59_2_
> from
> dbo.practice practice0_
> inner join
> dbo.location locations3_
> on practice0_.practice_id=locations3_.practice_id
> and (
> locations3_.practice_id=practice0_.practice_id
> ),
> dbo.publication publicatio1_,
> dbo.usergroup usergroup2_
> Notice how the table aliases for publication and usergroup are incorrectly placed.
--
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