Quick will create a join on each child-table when loading an child through a parent

There seems to be a pretty big issue with how quick loads child entities through the parent when using multi-table inheritance and discriminated child entities.

In the background quick will generate a query and add a join onto each child table / discriminated entity. As it is common to name the foreign key in each child the same, when quick maps the data from the query onto the properties of the entity you could land up with a situation where the foreign key is an empty string in the child table depending on the order of the joins.

I have created some test case to show this issue.

Test cases for regression when retrieving child classes through parent by ryanalbrecht · Pull Request #251 · coldbox-modules/quick (github.com)

Interested in comments on how to solve this issue.