HQL generates inner join when selecting a specific attribute that is linked to another entity

Description

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.

Environment

Oracle 9i, affects ONLY version 3.2.2, was still working OK in version 3.2.1 and before.

Activity

Show:
Steve Ebersole
March 21, 2011, 7:09 PM

Bulk closing stale resolved issues

Assignee

Gail Badner

Reporter

Peter Mutsaers

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Critical
Configure