I second Jon's idea to use the a SQL delete query in a normal
<cfquery>, and then tell transfer to discard the stuff in the cache
that wouldn't be correct anymore. The database was designed to do this
really fast (tons faster than a loop over objects that might not even
be in transfer's cache yet). I think you could probably write one that
only deletes things that wouldn't orphan the stuff like you described.
Just wrap that up in a method in your service layer, and huzzah!
As a side note, TQL doesn't actually have a DELETE statement...
yet. :/
- Elliott
> > On Fri, Jul 11, 2008 at 3:53 PM, Mark Mandel <
mark.man...@gmail.com>
> > wrote:
>
> >> If you have the collection from one object -> another
>
> >> Why not just loop around your collection of objects, and then do a
> >> check - if it's meant to be there, keep it, if it's not,delete it,and
> >> if it's not there, add it.
>
> >> Doesn't seem like that big an issue.
>
> >> If you are using m2m, then it manages this for you.
>
> >> Mark
>
> >> On Sat, Jul 12, 2008 at 8:40 AM, Jennifer Larkin <
jlar...@gmail.com>
> >> wrote:
> >> > The reason that we aren't using a manytomany in this case is that I set
> >> it
> >> > up and I am flying by the seat of my pants, which luckily are sturdier
> >> than
> >> > they look.
>
> >> > So, we can use manytomany for some of the junction tables but not for
> >> > others. It sounds like we actually need two different ways of doing this
> >> > based on whether the junction table contains columns in addition to the
> >> > composite keys, because we shouldn't be using manytomany on tables that
> >> > contain additional columns.
>
> >> > On Fri, Jul 11, 2008 at 2:27 PM, Brian Kotek <
brian...@gmail.com>
> >> wrote:
>
> >> >> There is for a Many to Many relationship, but not for One to Many or
> >> Many
> >> >> to One. If this table is ONLY a linking table, is there a reason why
> >> you
> >> >> aren't using a Many to Many relationship, because what you're
> >> describing is
> >> >> exactly what the Many to Many relationship is meant to be.?
>
> >> >> Otherwise, yes, you'll either have to loop over them and delete them,
> >> then
> >> >> rebuild it. Another option would be to determine which values changed
> >> and
> >> >> then loop over and remove only the ones that were removed and add the
> >> ones
> >> >> that were added.
>
> >> E:
mark.man...@gmail.com