mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-695: throw error on non-existing relation target column #853
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 @doctrinebot on GitHub (Jul 19, 2010).
Jira issue originally created by user cicovec:
I had a problem with invalid SQL generated from DQL using JOIN the DQL query was as simple as:
SELECT k, kt FROM Kmz k JOIN k.kmzType kt
the final SQL missed the joined column name:
SELECT k0_.ID_KMZ AS ID_KMZ0, k0_.ID_KMZ_TYPE AS ID_KMZ_TYPE1, k0_.IDENTIFICATOR_HW AS IDENTIFICATOR_HW2, k0_.TIME_INSERT AS TIME_INSERT3, k1_.ID_KMZ_TYPE AS ID_KMZ_TYPE4, k1_.SHORTNAME AS SHORTNAME5, k1_.DESCRIPTION AS DESCRIPTION6, k0_.id_KMZ_TYPE AS id_KMZ_TYPE7 FROM KMZ k0_ INNER JOIN KMZ_TYPE k1_ ON k0_.id_KMZ_TYPE = k1_.
After some time of xdebugging I found that the names in JoinColumn clause in Kmz class annotation were not UPPERCASE as in KmzType - I just got a notice in SQL walker (line 728).
I think there might be a check and error thrown in case of missing targetColumn.
@doctrinebot commented on GitHub (Aug 12, 2010):
Comment created by @guilhermeblanco:
This is not related to DQL.
We have a validate-mapping CLI command that can verify this for you.
The problem you have is a bug in your mapping definition, nothing related to Doctrine core.
If we add exceptions to all situations, DQL could not perform well. =\
Marking as won't fix.
@doctrinebot commented on GitHub (Aug 12, 2010):
Issue was closed with resolution "Won't Fix"