mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-2537: One to one relation requires a join to get the details for the proxy object #3180
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 (Jul 1, 2013).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user legolas:
I have the entities Cart(owning side) and Customer(inverse side) sharing bidirectional one to one relation. Now when I get an entity of cart, the proxy object for the customer is automatically linked to it. But when I ask that proxy object of customer for its name, it performs a join query with the cart and customer table to fetch it instead of just querying the customer table with the corresponding customer id present with the cart entity. The one to many relation works fine as explained in documentation. But this kind of strange thing is happening with one to one relation.
The following code explains the detail.
@doctrinebot commented on GitHub (Jul 1, 2013):
Comment created by legolas:
Okk I am mistaken. I am replying to my own post as I figured out the issue.
In the bidirectional one to one relation, whenever the inverse side entity is loaded, it fetches(eager) the owning side entity automatically that requires the join.
So this is not a bug.
@doctrinebot commented on GitHub (Aug 10, 2013):
Issue was closed with resolution "Invalid"