cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Murphy <>
Subject Is registerNewObject() required?
Date Mon, 01 Sep 2008 06:57:15 GMT

I have a relationship between two entities whereby a Worker references 
another Worker. The name of the relationship is 'actualBelongsToGroup'. 
When I try to set one on the other using this relationship, Cayenne baulks:

Caused by: java.lang.NullPointerException

The problem occurs because getDataContext() on the <being set> worker is 
returning null.

Do I have to dataContext.registerNewObject( <being set worker>) on the 
<being set worker> before calling setActualBelongsToGroup( <another 
worker>) on it? 

What is the philosophy here? I thought I would be able to put together a 
graph of objects, without regard to persistence issues, then later 
register them, then commit?

thanks - Chris

Seaweed Software Pty Ltd,

View raw message