Adding PK proxy using field access to non-pk mapped collection results in NULL constraint violation

Description

A simple model that maps a collection through a unique column

When trying to add a RelatedObject reference to the collection, the flushing fails with a NULL constraint violation, although the proxy is lazily initialized.

Note that it works when using property mapping instead, so this seems to be related to the proxy not being narrowed before being accessed.

Environment

None

Assignee

Unassigned

Reporter

Christian Beikov

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