cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aristedes Maniatis <...@ish.com.au>
Subject Re: Relationships of unsaved object
Date Thu, 05 Jun 2008 12:55:48 GMT

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



Mime
View raw message