On 9/28/07, Marc Torres <[EMAIL PROTECTED]> wrote:
> I've no tested it, but have you tried:
>
>  $c->addJoin(FooPeer::BAR_ID, BarPeer::ID, Criteria::LEFT_JOIN);
>
>  and pass this criteria to the doSelectJoinBar method?

Just tried it, and it's not working because the join is not
overwritten, so both of them are used in the query.

I've also tried modifying the Base*Peer class itself to use left
joins, but then it tries hydrating the non-existent objects, producing
corrupted objects with NULL in all fields. I guess I'll also have to
add some checks to see if the referenced object has a non-null PK
before hydrating...

> Anyway, I agree with Dan, the default join is a inner join, so it's normal
> that the Foo objects that don't have any Bar_ID set, are descarted. If you
> want them, you've to do a LEFT JOIN explicitly.
But the whole point of the doSelectJoin*() methods is that they
resolve one or more foreign keys for you without any extra work, so
when you'll need to get() the referenced object it won't require a
query because the object is already hydrated. However, resolving a
foreign key without using a left join is definitely NOT the right way
to do it.

> Moreover, this is not a
> directly related symfony question, it's better to ask in the propel mailing
> list (just a thought).
As mentionned before I've asked the Propel mailing list too. I've only
got replies from the symfony list so far though.
-- 
- SR

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to