IS NULL doesn't work on not-owning side of one-to-one relationship

Description

https://github.com/schauder/issue-datajpa-1404-is-null-on-one-to-one/tree/hibernate demonstrates the issue.

Given two entities as follows

and

The following test fails, because the query returns an empty list:

Making the reference unidirectional going from Parent to Child results in the query resulting in a single result as expected.

This is related to https://jira.spring.io/projects/DATAJPA/issues/DATAJPA-1404

The OP there indicated that DATAJPA-1404 did not appear in earlier versions of Spring Data, but that was possibly not because the query working in Hibernate, but Spring Data using a different query.

Also, since Spring Data generates these queries via Criteria API I expect the same problem also to occur when using the Criteria API to construct an equivalent query.

Environment

None

Activity

Show:
Jens Schauder
December 18, 2018, 7:25 AM

Looks like the issue is already known.

Alex Zaytsev
March 26, 2019, 11:03 AM

Assignee

Unassigned

Reporter

Jens Schauder

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

Major
Configure