Optional one-to-one does not always join the associated entity table when querying

Description

Using the following entities:

If there exists a Foo entity, but there is no Bar entity with the same ID value as the Foo entity, then the following query, "from Foo where bar.id = ?1", should return null.

Instead, the query returns a Foo object with property bar set to null. This happens because the generated SQL does not include a join to the Bar entity table, as it should.

Notice that the query uses the "generic" ID named "id", not the actual ID (barId).

Environment

None

Assignee

Gail Badner

Reporter

Gail Badner

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.3.15

Affects versions

Priority

Major
Configure