Re: My Laziness is Getting the Better of Me

From: Gary Jarrel (garyjarre..mail.com)
Date: Thu Jun 29 2006 - 23:36:53 EDT

  • Next message: Andrus Adamchik: "Re: writeNestedProperty"

    But wouldn't the call to
    dataContext.deleteObjects(slideshow.getImages()); actually delete the
    image records from the image table (upon commit). All I'm trying to do
    is clear the relationship table, because any given image form part of
    any number of slideshows. Hence I don't want to delete the actual
    images just the link (record in join table) between Slideshow & Image

    - garyj

    PS. Australia is just too far away from the world, hence Friday here :)

    On 6/30/06, Michael Gentry <blacknex..mail.com> wrote:
    > 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 <garyjarre..mail.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
    > >
    >



    This archive was generated by hypermail 2.0.0 : Thu Jun 29 2006 - 23:37:19 EDT