You'd probably want to reverse the order of your deletes, or you could run
into foreign key constraint violations if you have your foreign keys set up
properly.
<cfset gtw = reactorFactory.createGateway("comment")>
<cfset gtw.deleteByQuery(entry_id=myvar)>
<cfset record = reactorFactory.createRecord("entry")>
<cfset record.delete(entry_id=myvar)>
-----Original Message-----
From: João Fernandes [mailto:[EMAIL PROTECTED] On Behalf Of João
Fernandes
Sent: Thursday, March 09, 2006 3:49 PM
To: [email protected]
Subject: RE: [Reactor For CF] why is there no "deleteByQuery" in
abstractgateway?
Doug,
it's always the same talk, developers always want a framework to do the job
for them :p I just saw David's post after sending my msg and maybe his
approach could be the best since you wouldn't have the Join problem.
Even if there is no cascading deletes it whould be very easy achieve it.
Imagine you want to delete a blog entry:
<cfset record = reactorFactory.createRecord("entry")>
<cfset record.delete(entry_id=myvar)>
<cfset gtw = reactorFactory.createGateway("comment")>
<cfset gtw.deleteByQuery(entry_id=myvar)>
Anyway, it's not difficult to implement it in the framework, I can always
change the xsl. Like David, I use a lot of this kind of stuff.
It's up to you to decide if it should be or not a reactor feature ;)
João Fernandes
-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Doug Hughes
Sent: Thu 09-Mar-06 9:31 PM
To: [email protected]
Subject: RE: [Reactor For CF] why is there no "deleteByQuery" in
abstractgateway?
Well, you couldn't have any joins in the query... that's one issue right off
the bat.
Make your case. This is the second person to ask for this... why is it
needed? It doesn't see like something that would be used frequently.
Couldn't you just create a delete method on your gateway? I've done this in
the past...
Doug
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of João
Fernandes
Sent: Thursday, March 09, 2006 3:35 PM
To: [email protected]
Subject: RE: [Reactor For CF] why is there no "deleteByQuery" in
abstractgateway?
Doug I have asked for this in the past:
simple table
user_id
name
country
email
the same way you can do
<cfset gtw = reactorfactoryobj.createGateway("myobj")>
<cfset query = gtw.createQuery()>
<cfset query.getWhere().isEqual()
....
....
....
<cfset gtw.getByQuery(query)>
we could do the same for delete
<cfset gtw = reactorfactoryobj.createGateway("myobj")>
<cfset query = gtw.createQuery()>
<cfset query.getWhere().isEqual("myobj","country","PT")>
<cfset query.getwhere().isLike("myobj","email","@cofina.pt","right")>
<cfset gtw.deleteByQuery(query)>
it whould delete all my records that would match country = 'PT' and email
like '[EMAIL PROTECTED]'
Cascading deletes whould be great but I would be happy with just this.
João Fernandes
-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Doug Hughes
Sent: Thu 09-Mar-06 7:45 PM
To: [email protected]
Subject: RE: [Reactor For CF] why is there no "deleteByQuery" in
abstractgateway?
Sorry, I was looking for something using reactor objects. IE:
I'd like the syntax for this to look like this:
*code Example*
And this means....
Etc, etc.
Doug
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter
Bell
Sent: Thursday, March 09, 2006 2:19 PM
To: [email protected]
Subject: RE: [Reactor For CF] why is there no "deleteByQuery" in
abstractgateway?
Delete from #table# Where #Filter# is how we do it. Table is known by
object, so you just pass filter. It does require knowledge of the object
properties, but we store that in the #EntityName#Service, so it's OK.
We also have a deletebyqueryimplications() which will return the captions
for any cascading deletes if you implement that (for composition to avoid
orphans) so you can tell people what you'll be doing before they do it.
Best Wishes,
Peter
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doug
Hughes
Sent: Thursday, March 09, 2006 2:13 PM
To: [email protected]
Subject: RE: [Reactor For CF] why is there no "deleteByQuery" in
abstractgateway?
How would this function? Can you provide some pseudocode?
Doug
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David A.
Cheslow PhD
Sent: Thursday, March 09, 2006 1:40 PM
To: [email protected]
Subject: [Reactor For CF] why is there no "deleteByQuery" in
abstractgateway?
The subject says it all. Seems to me that a deleteByQuery() would be pretty
handy (and easy to add) right there. Or have I missed something very
obvious?
=dave=
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/
****************************************************************************
This email may contain confidential material.
If you were not an intended recipient,
Please notify the sender and delete all copies.
We may monitor email to and from our network.
****************************************************************************
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/