cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcin Skladaniec <>
Subject problems in setting reverse relationship
Date Mon, 11 May 2009 01:23:22 GMT

I have noticed a problem in ROP cayenne. It seems like the reverse  
relationship is not set until the actual relation is faulted.
Simple example:

this works correctly:
logger.warn(artist.getPaintings().size()); -> prints 0
logger.warn(artist.getPaintings().size()); -> prints 1

this does not work correctly:
//logger.warn(artist.getPaintings().size()); -> commented out, no output
logger.warn(artist.getPaintings().size()); -> prints 0

Regardless of which of the examples are the objects are committed to  
db in both cases, and all seems well after a new select query.

additionally for this setup I found another issue which might be  
related. when calling artist.addToPaintings(painting) on client I get  
following exception on server:

[java] Caused by: java.lang.Exception: [v.3.0-SNAPSHOT $ 
{} ${}] Can't build a query for  
relationship 'artist' for temporary id: <ObjectId:Painting, TEMP: 
is that related?

does anyone have any clues on what might be wrong?
I'm baffled with this one...

Best regards

View raw message