Re: Relationships of unsaved object

From: Aristedes Maniatis (ar..sh.com.au)
Date: Thu Jun 05 2008 - 08:55:48 EDT

  • Next message: Michał Morzywołek: "Re: Relationships of unsaved object"

    On 05/06/2008, at 10:34 PM, MichaƂ MorzywoƂek wrote:

    > Person p=new Person(); //not registered in cayenne
    >
    > after doing that i can't set any relationships (like with the
    > address). (1)
    >
    > After i register Person p in Cayenne i can set up relationships but
    > only
    > with registered objects. (2)
    >
    > Is there any way to do such things? (1)(2)
    > Or it is supposed to be like that?

    You will need to create your new object like this:

    Person p = (Person) context.newObject(Person.class);

    Cayenne 3 does have the ability to work with POJOs, but traditional
    Cayenne API differs from Hibernate in this important way. Have a look
    at http://cayenne.apache.org/doc/tutorial-dataobjects.html for more
    information.

    Ari Maniatis

    -------------------------->
    ish
    http://www.ish.com.au
    Level 1, 30 Wilson Street Newtown 2042 Australia
    phone +61 2 9550 5001 fax +61 2 9550 4001
    GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A



    This archive was generated by hypermail 2.0.0 : Thu Jun 05 2008 - 08:56:30 EDT