Jira issue originally created by user @beberlei:
Possible issue with multiple levels of Mappedsuperclasses and wrong sql table aliases
Comment created by kbond:
Any update on this, is there a work-around?
Comment created by @beberlei:
I could not reproduce this yet, can you provide me with a reproduce case?
https://gist.github.com/1107578 shows my entity inheritance structure:
Entity (MappedSuperClass) -> Page -> BaseClassification (MappedSuperClass) -> Species
...->getRepository('Species')->findOneByPath('path') gives me this error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.path' in 'where clause'
The query being generated is as follows:
'SELECT t1.body AS body2, t1.path AS path3, t1.id AS id4, t1.title AS title5, t1.updatedat AS updated_at6, t1.created_at AS created_at7, t1.alternate_names AS alternate_names8, t1.latin_name AS latin_name9, t1.genus_id AS genusid10 FROM species t1 WHERE t0.path = ?'
that t0 is an alias that does exist.
If you need further information, let me know.
Comment created by @guilhermeblanco:
Your mapping is wrong.
Species entity extends from BaseClassification, which contains no "path" field. The only "path" that exists is in Page entity, which has nothing hierarchically to Species entity.
Marking this issue as invalid. Reopen if you after your mapping fix the issue still persist.
Issue was closed with resolution "Invalid"
Hmm, not sure what you mean? BaseClassification extends the Page entity... Should BaseClassification not contain all the fields from Page and Species not all the fields from BaseClassification?