Re: Deleting n:m relationships

2012-08-01 Thread Tobias Wolff
Thanks Emanuele, I changed it now to: // Delete any condending ads List toDelete = new ArrayList(); for(ForecastContendingLineItem temp : _forecastItem.getForecastContendingLineItemArray()) { toDelete.add(temp); } config.context().deleteObject

Re: Deleting n:m relationships

2012-08-01 Thread Emanuele Maiarelli
forgot to disable html formatting of email client, and it have been formatted badly :) List toDelete=new ArrayList(); toDelete.addAll(_forecastItem.getForecastContendingLineItemArray()); for(ForecastContendingLineItem temp : toDelete) { _forecastItem.removeFromForecastContending

Re: Deleting n:m relationships

2012-08-01 Thread Emanuele Maiarelli
Also try to replace // Delete any condending ads for(ForecastContendingLineItem temp : _forecastItem.getForecastContendingLineItemArray()) { _forecastItem.removeFromForecastContendingLineItemArray(temp); } with List toDelete=new ArrayList(); toDelete.addAll(_forecastItem.getForecastCon

Re: Deleting n:m relationships

2012-08-01 Thread Emanuele Maiarelli
you should create ForecastContendingLineItem from a contex using context.newObject(ForecastContendingLineItem.class); On Wed, 1 Aug 2012 13:08:36 +0200, Tobias Wolff wrote: > Hi again, > > so, I now tried this: > > // Delete any condending ads > for(ForecastContendingLineItem temp : > _

Re: Deleting n:m relationships

2012-08-01 Thread Tobias Wolff
Hi again, so, I now tried this: // Delete any condending ads for(ForecastContendingLineItem temp : _forecastItem.getForecastContendingLineItemArray()) { _forecastItem.removeFromForecastContendingLineItemArray(temp); } // Now deal with the contending ads

Deleting n:m relationships

2012-07-31 Thread Tobias Wolff
Hi, I am currently trying to do the following in Cayenne 3.0.2: * fetch an object A * delete some related objects which are related to A in an n:m relation * add new objects to A (same n:m relation) I have undergone a couple of java.util.ConcurrentModificationException and org.apache.cayenn