Foreign key columns are not being preloaded by default

Description

Given the following ParentEntity:

And the following ChildEntity:

Here's what happens, when a child entity is being accessed:

In my opinion, when declaring @Preload (which should be the same as @Preload("*")) on the child entity, the column PARENT_ID should have been preloaded as well in the first query and the last query shouldn't really be necessary at all. The impact of this behavior is even bigger, when e.g. you need to loop over a set of child entities and need to get the parent ID to build a link to the parent entity.

Workaround

The current workaround is to explicitly list all the columns of the child entity in the @Preload annotation:

If this works as designed, there should at least be a note in the @Preload documentation.

Environment

None

Testing Notes

Add notes...

Assignee

Unassigned

Reporter

Remo Siegwart

Labels

None

Add-on Type

None

Team

None

CC

None

Risk factor

None

QA Kickoff Status

None

QA Demo Status

None

Components

Priority

Minor
Configure