cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Gentry" <blackn...@gmail.com>
Subject Re: My Laziness is Getting the Better of Me
Date Fri, 30 Jun 2006 01:42:06 GMT
http://www.objectstyle.org/confluence/display/CAYDOC/Deleting+Objects


So, I think:

dataContext.deleteObjects(slideshow.getImages());

might do the trick for you.

/dev/mrg

PS. It isn't Friday here yet ...
PPS. Don't forget to do a dataContext.commitChanges(), too.


On 6/29/06, Gary Jarrel <garyjarrel@gmail.com> wrote:
> Hey All
>
> It's Friday, and I guess my thinking process has already switched into
> weekend mode, but whats the best way to clear all records in a
> relationship. I.e. the following objects
>
> Slideshow -> (to may) -> Image      (join table in betwen)
>
> Slideshow.getImages() returns a list of images, how can I easily clear
> this list, cause the good old iterate over the list and remove using
> slideshow.removeFromImages(Image)  doesn't seem to work as the list
> decreases hence sending the cursor off.
>
> Sorry if the question is too obvious. :)
>
> - garyj
>

Mime
View raw message