mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-335: Refactor DQL EBNF to use JOIN FETCH as syntax for fetch joins only #415
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 (Feb 14, 2010).
Jira issue originally created by user @beberlei:
There are several problems with the current approach on fetch joins:
Solution, change the EBNF too:
Question would be how to specify partial object selects.
Romans idea was something like:
However my take is this would again put information into the select clause that might be interesting elsewhere, so
That way we could add both $isFetchJoin and $isPartial flags to the AST/Join Node plus an additional $partialFields array.
@doctrinebot commented on GitHub (Feb 14, 2010):
@doctrinebot commented on GitHub (Feb 16, 2010):
Comment created by @beberlei:
Ah just to remember, the idea on the partial fetch syntax was something like:
@doctrinebot commented on GitHub (Feb 16, 2010):
Comment created by @beberlei:
I think this will also make the HINT_PARTIAL_LOAD constant obsolet, since the DQL is already implicitly requesting a partial load.
@doctrinebot commented on GitHub (Feb 16, 2010):
Comment created by romanb:
Regarding HINT_FORCE_PARTIAL_LOAD: Not necessarily, but it might need to be renamed since its still used to decide whether to stub associations with empty collections/proxies.
Anyways, I've played around a bit with different implementations in the last days and I changed my mind regarding changing the fetch join syntax. It has many complications, like more difficult sql construction in the walker, among other things, and of course the fact that it would be a huge bc break.
However, some things will change. "select u.name" will select a scalar value, as you expect. The new syntax for partial object selection will currently be:
There will be a new AST node PartialObjectExpression that represents such a construct.
Thats the current state of my progress. Regarding the isFetchJoin/isPartial decisions, we need to find another way and I'm confident there are some other ways.
So far...
@doctrinebot commented on GitHub (Feb 16, 2010):
Comment created by @beberlei:
If we change u.name to retrieving a scalar value always its easy to get all the fetch joins identification variables inside the SELECT already:
If (identificiationVariable) => fetchJoin
Then when the join is found, you can mark the Join as Fetch already.
@doctrinebot commented on GitHub (Feb 19, 2010):
Comment created by romanb:
Implemented.
@doctrinebot commented on GitHub (Feb 19, 2010):
Issue was closed with resolution "Fixed"