Changing relationships using only PK

From: Daniel Kvasnička jr. (daniel.kvasnicka.j..mail.com)
Date: Mon Jan 07 2008 - 08:06:40 EST

  • Next message: Andrus Adamchik: "Re: Selective commit"

    Hi people,
    I would like to add an object to a M:N relationship. Cayenne generated
    those convenience methods starting with "addTo". These take DataObject
    as a parameter and I noticed that it has to be a context-registered
    object -- correct?

    So if I have a collection of primary keys that correspond to primary
    keys of objects I want to add to the relationship, I need to fetch
    those objects for those PKs and then add them to the relationship --
    correct?
    Is it possible to add a object only on the basis of it's PK? Or do I
    need to fetch the data first to ensure the object I want to bind is
    still valid?

    I know I could always do these things with raw sql, but I wanted to
    know if there is any object way to do this.

    I'm probably only missing something, so thanks for every hint ;)

    Dan

    -- 
    http://www.danielkvasnicka.net -- webdesign & corporate design,
    programování internetových a intranetových aplikací
    



    This archive was generated by hypermail 2.0.0 : Mon Jan 07 2008 - 08:07:13 EST