mirror of
https://github.com/doctrine/orm.git
synced 2026-04-24 06:58:19 +02:00
DDC-633: fetch="EAGER" is not loading one to one associations #786
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 (Jun 11, 2010).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user ccapndave:
When doing a findAll() on appointments, $patient is being created as a proxy even though fetch is EAGER.
@doctrinebot commented on GitHub (Aug 8, 2010):
Comment created by @beberlei:
Fixed in master
@doctrinebot commented on GitHub (Aug 8, 2010):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Aug 17, 2010):
Comment created by majkl578:
What is an advantage of this solution (in master) if it is loaded in the same way as when fetched lazily? Maybe it'd be better to use INNER JOIN instead, at least for OneToOne and save one or more (probably unnecessary) SQL queries?
@doctrinebot commented on GitHub (Aug 17, 2010):
Comment created by @beberlei:
There is none (yet), it may be a future enhancement, however we dont know this yet. fetch=EAGER is not so useful at the moment.
@doctrinebot commented on GitHub (Aug 17, 2010):
Comment created by majkl578:
I think that fetch=EAGER should behave like this DQL:
SELECT a, b FROM foo a JOIN a.bar b
This query will use INNER JOIN to load "a.bar" association, but fetch=EAGER won't.
Should I open a new issue for this?
@doctrinebot commented on GitHub (Sep 28, 2010):
Comment created by edke:
fetch=EAGER still is not working as I think it should.
class Project {
but after
$this->getEntityManager()->find('\Entities\Project', $this->project);
2 doctrine queries are executed:
SELECT t0.id AS id1, t0.name AS name2, t0.paths AS paths3, t0.modified AS modified4, t0.created AS
created5, t0.has_running_tasks AS has_running_tasks6, t0.tasksCount AS taskscount7, t0.productsCount
AS productscount8, t0.id_client AS id_client9
FROM projects t0
WHERE t0.id = ?
SELECT t0.id AS id1, t0.name AS name2, t0.modified AS modified3, t0.created AS created4
FROM clients t0
WHERE t0.id = ?
And it should be one query with inner join to clients.
@doctrinebot commented on GitHub (Sep 28, 2010):
Comment created by @beberlei:
Eager doesnt mean it does a Join, it only means the query is executed directly
@doctrinebot commented on GitHub (Sep 28, 2010):
Comment created by edke:
I see. And how can be achieved that product and client will be queried at once, and not only when I request product->getClient() ?