[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-2402) HQL generates inner join when selecting a specific attribute that is linked to another entity

Gail Badner (JIRA) noreply at atlassian.com
Tue Sep 21 13:21:22 EDT 2010


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

Gail Badner resolved HHH-2402.
------------------------------

      Assignee: Gail Badner
    Resolution: Duplicate

> HQL generates inner join when selecting a specific attribute that is linked to another entity
> ---------------------------------------------------------------------------------------------
>
>                 Key: HHH-2402
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2402
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.2, 3.6.0.CR1
>         Environment: Oracle 9i, affects ONLY version 3.2.2, was still working OK in version 3.2.1 and before.
>            Reporter: Peter Mutsaers
>            Assignee: Gail Badner
>            Priority: Critical
>
> Mapping (note the lazy='false', it is essential to cause the problem):
> <class name='Currency' lazy='false'>
>    ....
> </class>
> <class name='Asset'>
>   <id name='id' ...   </id>
>   <many-to-one name='currency' class='Currency' fetch='select'/>
> </class>
> The following HQL query: "select a.id, a.currency from Asset a"
> used to generate a query on the Asset table, and subsequently generates separate queries on the Currency table.
> Since version 3.2.2, this generates an inner join on Asset with Currency.
> Now many Assets may have a NULL currency, so we do not get all records anymore!
> This breaks logic and queries all over the place for us.
> We can't go back to 3.2.1 due to other bugs that had been solved in 3.2.2.
> The query "from Asset a" still works OK and as before, i.e. it makes the select only on the Asset table and afterwards fetches the Currency with individual selects.
> I fear that an optimization has been made that has this negative side effect.

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