comparing entities instead of ids in JPQL doesn't seem to work the same way as comparing ids

Description

I have the following 2 snippets, that generated their respective JPQL and sqls:

The weird part is that the first snippet with the .id generates (unnecessarily?) complicated SQL but is the one that works (ie: manages to retrieve the desired row). while the second one that generates what looks to me like the correct SQL query fails.

Any idea why this would happen? thanks.

Environment

None

Activity

Show:
Youssef EL HOUTI
November 22, 2020, 12:18 PM

Note: Problem only happens on OneToOne relationship, same code works great with ManyToOne

Assignee

Unassigned

Reporter

Youssef EL HOUTI

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major
Configure