Re: NullPointerException in addToManyTarget and removeToManyTarget

2016-04-09 Thread Michael Gentry
Hi Juan, As you've discovered, adding/removing relationships require the Cayenne objects to be registered in an ObjectContext (typically a DataContext). Generally you'll create and register your objects in an OC using: DocumentoInventario documentoInventario = objectContext.newObject( DocumentoIn

NullPointerException in addToManyTarget and removeToManyTarget

2016-04-08 Thread Juan Manuel Diaz Lara
I am using Cayenne 4.0.M3. I want to build an graph of persistent objects  using the api for many targets, but I get the following trace: Exception in thread "main" java.lang.NullPointerException     at org.apache.cayenne.CayenneDataObject.addToManyTarget(CayenneDataObject.java:248)     at com.a