quick
quick copied to clipboard
Test cases for regression when retrieving child classes through parent
Its seems between v6 and v9 there was a major regression. ( edit: I think this might have always been this way)
When using multi-table inheritance and you try to load a child class through a parent entity, quick will generate a query that has a join onto each child table. As each child class will often have their foreign key to the parent named the same, this causes an issue when the child class is instantiated as it could land up with an empty value depending on the order of the joins.
This subsequently causes an exception to be thrown when updating loaded entities as the foreign key will not be present in the child class.
This is a big issue and not 100% how to fix it but I created some tests case for showing the failure and the exception