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.
Note: Problem only happens on OneToOne relationship, same code works great with ManyToOne