Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Can't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Security Level: All
-
Labels:None
Description
Let's assume the following class hierarchy:
AbstractComment SpecialComment extends AbstractComment { private $specialAssociation; } RegularComment extends RegularComment
Now, I'd like to write a query such as:
SELECT c, a FROM AbstractComment c LEFT JOIN c.specialAssociation a
The idea is to preload the association when selecting all comments. Now, that association is only present on a sub-class of the queried class, but since it is a single table inheritance, Doctrine should be able to join it for those entities where it is present.
At the moment unfortunately, Doctrine shows an error that the association does not exist on the AbstractComment class. Also, there is no real alternative to this except moving the collection to the base class even if it does not belong there.
Activity
Johannes Schmitt
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Description |
Let's assume the following class hierarchy:
{code} AbstractComment SpecialComment extends AbstractComment { private $specialAssociation; } RegularComment extends RegularComment {/code} Now, I'd like to write a query such as: {code} SELECT c, a FROM AbstractComment c LEFT JOIN c.specialAssociation a {code} The idea is to preload the association when selecting all comments. Now, that association is only present on a sub-class of the queried class, but since it is a single table inheritance, Doctrine should be able to join it for those entities where it is present. At the moment unfortunately, Doctrine shows an error that the association does not exist on the AbstractComment class. Also, there is no real alternative to this except moving the collection to the base class even if it does not belong there. |
Let's assume the following class hierarchy:
{code} AbstractComment SpecialComment extends AbstractComment { private $specialAssociation; } RegularComment extends RegularComment {code} Now, I'd like to write a query such as: {code} SELECT c, a FROM AbstractComment c LEFT JOIN c.specialAssociation a {code} The idea is to preload the association when selecting all comments. Now, that association is only present on a sub-class of the queried class, but since it is a single table inheritance, Doctrine should be able to join it for those entities where it is present. At the moment unfortunately, Doctrine shows an error that the association does not exist on the AbstractComment class. Also, there is no real alternative to this except moving the collection to the base class even if it does not belong there. |
Benjamin Eberlei
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Can't Fix [ 7 ] |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2250, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
DQL has strict typing with regard to inheritance, this type of query is not possible.