Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.2.2
-
Fix Version/s: None
-
Component/s: DQL
-
Security Level: All
-
Labels:None
-
Environment:LAMP, debian squeeze
Description
I'm having big troubles while developing a quietly advanced DQL query for a tiny DMS: The schema: DmsObject is a superclass for which two subclasses exist (document and folder) UserRights and GroupRight (which are associative entities in the db, pointing respectively to user and group tables). User and Group represent (obvious) the dms "actors".
SELECT o, ur, gr from module\EDMS\business\DmsObject o join o.userRights ur join o.groupRights gr WHERE o.ownerUser=ur.user AND o.ownerGroup=gr.group
The WHERE condition is WRONG! Doctrine switches the two tables. I've already checked the mapping (it's ok!) and checked also where the fk's point in the database (ok!).
...
LEFT JOIN dms_folder d1_
ON d0_.id = d1_.id
LEFT JOIN dms_document d2_
ON d0_.id = d2_.id
INNER JOIN dms_user_object_rights d3_
ON d0_.id = d3_.document_id
INNER JOIN dms_group_object_rights d4_
ON d0_.id = d4_.document_id
WHERE d0_.sys_group_owner = d3_.user_id
AND d0_.sys_user_owner = d4_.group_id
...
This seems to be a bug in the DQL translator.
Issue Links
- is duplicated by
-
DDC-2235
Single table inheritance discriminator in WHERE when using arbitrary join syntax
-
Enea Bette Can you attach the entities (stripped down to the fields we need here)?
Can you check guilherme? This looks really weird.
It should be: