mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Three level table class inheritance not loading second level data due to wrong query generation #6458
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lsrzj on GitHub (Apr 30, 2020).
I have a inheritance of three levels using class table inheritance like this:
Class Test
Class TestM extends Test
Class TestA extends TestM
I'm having problem because, when I'm going to retrieve the entity from my DB, it comes with the second level with no data, only the first and last levels comes with all the data. Notice that columnTestM is blank. Is it a bug or am I missing something? It's persisting all three levels with data, the problem is only when I have to get it. As an example I put the column's content with it's own name
EDIT:
I put my MariaDB to log all queries to check what query was being generated and I noticed that, instead of generating a query that involves TestM, it tries to left join with TestB. Below the generated query:
@mpdude commented on GitHub (Jan 13, 2023):
Your discriminator map does not contain the abstract entity from the middle of the hierarchy.
Follow #10389 to find out if that is a misconfiguration on your side and the issue being invalid; or it is a valid issue and #10388 at least showing test cases (not fix yet).
@mpdude commented on GitHub (Jan 18, 2023):
#10411 takes care of filling the missing abstract classes in the DM, and your example should now be working.