Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: 2.0-ALPHA2
-
Fix Version/s: None
-
Component/s: DQL
-
Security Level: All
-
Labels:None
Description
I have a classes B and C which inherit from superclass A. I would like
to get a list of all A's but filter the list to ignore those in C
which have a property d set to 2.
select a from A where a.d == 2 fails because "d" is not a property of A.
Issue Links
- is duplicated by
-
DDC-1377
Doctrine doesn't understand associations from SINGLE_TABLE inheritances
-
I am closing this one.
The requirement of this issue is basically violating OO principles.
If you really need to filter across multiple child-entities in your inheritance, then try something as following instead:
SELECT r FROM Root r WHERE r.id IN ( SELECT c.id FROM Child c WHERE c.field = :value )Up-casting is not really a viable solution anyway, since it would be even more weird to cast in DQL and then have hydration still retrieve the root entity type.