Select via Criteria API does not properly retrieve one to one reference

Description

Given the following entity classes:

and instances created and persisted with

The following query created via the Criteria API fails to retrieve the referenced EntityTwo, i.e. the test fails at the line indicated by a comment:

Interestingly the generated SQL statement looks correct:

I'll make a reproducer available in a moment.

Environment

None

Activity

Show:
Jens Schauder
April 13, 2021, 6:26 AM

Is that PR available as a Snapshot somewhere? The build fails on my machine

Christian Beikov
April 12, 2021, 3:39 PM

Can you check if the fix in resolves your issue?

Jens Schauder
April 12, 2021, 1:03 PM

The mapping with @MapsId @JoinColumn(name = "id") seems to be essential to reproduce the issue.

Jens Schauder
April 12, 2021, 1:00 PM

Reproducer:

Related Spring Data JPA issue:

Assignee

Unassigned

Reporter

Jens Schauder