Re: Left joins

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Sep 01 2004 - 09:18:05 EDT

  • Next message: Andrus Adamchik: "Re: add LIMIT statement? (reduce size of resultset)"

    When resolving to-one relationships, Cayenne returns null if there is
    no target row for the FK, so normally no outer joins are required. The
    behavior that you describe is possible if you have referential
    integrity problems (i.e. you have FK pointing to a non-existent row).
    Then catching the exception is appropriate, as it is not a normal
    situation.

    If this is NOT the case, that I need to know how your relationship is
    mapped, so either send me a DataMap directly, or open a bug report and
    attach it to the ticket. In both cases, post a stack trace.

    Thanks
    Andrus

    On Aug 31, 2004, at 10:54 PM, Lindsay Steele wrote:

    > All the other stuff is now working well .. thanks for all the help.
    >  
    > I have searched the mailing list archives on gmane and can't seem to
    > find and answer for this one. Gmane is doing strange
    > things with my searches too ... are there any other searchable
    > archives of the mailing list ??
    >  
    > I am just wondering if there is anything like a left join.   
    >  
    > I am using the following line.
    >  
    > "call.getToExtension().getToDepartment().getDepartmentName()" 
    >  
    > The extension does not exist .. but that is ok - I still want to
    > return the record.
    >  
    > It would be good if it simply returns null ... but it throws and
    > exception that it cannot find the object.
    >  
    > Is there another way to do this or should I just wrap some exception
    > code around it and deal with it.
    >  
    > Thanks,
    >  
    >             Lindsay



    This archive was generated by hypermail 2.0.0 : Wed Sep 01 2004 - 09:18:13 EDT