mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-419: Problem when I make a INNER JOIN between 2 classes #523
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 (Mar 12, 2010).
Jira issue originally created by user hgirardi:
I hae some problems when I make a inner join between 2 classes, one of these classes makes join to others 2 classes in the same time and when I try to make a inner to this class, it's not coming like a object, but object Id...
I don't know why its happening..
I make a test case..there're all the classes and yml that show my problem..it's on ItemPregaoTest.php.. just need to run phpunit in this file..
@doctrinebot commented on GitHub (Mar 12, 2010):
@doctrinebot commented on GitHub (Mar 14, 2010):
Comment created by @beberlei:
This is what returns for me:
The expected result I guess. What happens for you?
@doctrinebot commented on GitHub (Mar 14, 2010):
Comment created by hgirardi:
Ok...this is what happen for me...
but I think the expected result would be
because 'public item' makes refereces to Item class, so I think it should give me a Item class, not its Id...
@doctrinebot commented on GitHub (Mar 16, 2010):
Comment created by hgirardi:
When I try to make a inner join between Item and ItemPregao, happens what I've said before, but if I make a inner join between Item and its refereces tables, it's working fine
It brings a class on 'classificacaoCatalogo' and inside classificacaoCatalogo you can see that 'classificacao' and 'catalogo' are objects too..so it worked! But If I make this:
do not work like before..
'item' should be a object, not a integer..
@doctrinebot commented on GitHub (Mar 16, 2010):
Comment created by @beberlei:
Ah now I see it. Yes, this seems to be a problem.
@doctrinebot commented on GitHub (Mar 18, 2010):
Comment created by @beberlei:
I have taken some time now trying to re-produce it, there is definately a bug i have identified, however i havent found the reason yet.
@doctrinebot commented on GitHub (Mar 18, 2010):
Comment created by hgirardi:
ok man!
I've try to find the reason too but I havent found yet too...
I dont know if there's something about the item are conected to a table that there're 2 table...
i dont know :S
@doctrinebot commented on GitHub (Mar 20, 2010):
Comment created by @beberlei:
I found the issue. A quick fix is to rename the join column to "item_id" instead of "item". This is causing the bug, we will look how to fix it.
@Roman:
This is particularly nasty, in UnitOfWork::createEntity the join column is set to the field name in $data, which makes the following code write the primitive FK value to the entity:
This then leads in the ObjectHydrator to:
not evaluating to null, but to the primitive value. the If condition does not match here and the relation is never set.
A simple solution would be to replace !$reflFieldValue with !is_object().
@doctrinebot commented on GitHub (Mar 20, 2010):
Comment created by @beberlei:
Attached a reproduce test-case.
@doctrinebot commented on GitHub (Mar 20, 2010):
Comment created by romanb:
I see. As their is an easy workaround, this is not a blocker, however.
@doctrinebot commented on GitHub (Apr 15, 2010):
Comment created by romanb:
DDC-522 needs to be fixed, then this issue is solved, too (its the same after all, the other issue is just more specific).
@doctrinebot commented on GitHub (Apr 15, 2010):
Comment created by romanb:
Scheduled for beta2
@doctrinebot commented on GitHub (Aug 8, 2010):
Comment created by romanb:
Should be fixed now in master.
@doctrinebot commented on GitHub (Aug 8, 2010):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Dec 13, 2015):
Imported 1 attachments from Jira into https://gist.github.com/486fc12da318be5d18ba