Skip to content

Loading…

DDC-1013: Possible issue with multiple levels of Mappedsuperclasses and wrong sql table aliases #1599

Closed
doctrinebot opened this Issue · 6 comments

2 participants

@doctrinebot

Jira issue originally created by user @beberlei:

Possible issue with multiple levels of Mappedsuperclasses and wrong sql table aliases

@doctrinebot

Comment created by kbond:

Any update on this, is there a work-around?

@doctrinebot

Comment created by @beberlei:

I could not reproduce this yet, can you provide me with a reproduce case?

@doctrinebot

Comment created by kbond:

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.

Thanks.

@doctrinebot

Comment created by @guilhermeblanco:

Hi,

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.

Cheers,

@doctrinebot

Issue was closed with resolution "Invalid"

@doctrinebot

Comment created by kbond:

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?

@doctrinebot doctrinebot added this to the 2.2 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.