cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: does Cayenne creates objects by hisself?
Date Sat, 22 Apr 2006 11:57:12 GMT
No, you'd have to associate the visitor with a particular user
somehow.   By default the relationship will be null.

visitor.setUser(user)

or

user.addToVisitorList(visitor)



On 4/22/06, WONDER <mmmmmmmmm53@web.de> wrote:
> Hi,
>
> I have the folloging situation.
>
> Entity "User"  has relation toMany "Visitor" its name is visitors.
>
> Usually if I "Fetch" the object Visitor from DB and then call
>
> visitor.user()
>
> Cayenne fetches the object User from the DB automatically.
>
>
> Now, creating a Visitor object.
>
> Visitor visitor = new Visitor();
>
> and calling
>
> visitor.user()
>
> will Cayenne here creates the object User automatically, or I have to do it by myself?
>
> Thanks.
>

Mime
View raw message