Marcin,

This is the expected Cayenne behavior on the server and on the remote client. It is designed to simplify relationship management and avoid object graph inconsistencies. I actually find it very useful. You are right about the implications, but I guess users should simply be aware of such behavior and implement their code accordingly.

Andrus


On Jun 19, 2006, at 8:42 AM, Marcin Skladaniec wrote:

Hello
Just run into interesting cayenne feature.

This code:

rooms = site.getRooms();
rooms.remove(aRoom);

would alter the relationship

so aRoom.getSite() is now null

I'm wondering if this is a desired effect ?
This behavior might cause bugs. When someone actually puts code to know the fact of relationship being changed (ie. put code into Room setSite() and Site add/removeFromRooms()/setRooms() methods ) he might be disappointed, as those methods would not run, but the relationship will change...

Regards
Marcin


-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001   fax +61 2 9550 4001

Reply via email to