On 7/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > How else can you do "bulk" insert/updates without doing a loop over a > SQL Insert/Update statement?
Bulk inserts are one thing. Like others have mentioned, your db platform usually provides tools for that, as well as tools for bulk copy or "replication". Bulk updates/deletes within application views, on the other hand, could also be a responsibility of your Table/Row Data Gateway(s). You could, for example, have customized methods in your Gateway implementation(s) for handing update/delete operations: personGateway.updateStatusById(ids, statusVal) or maybe, personGateway.deleteById(ids) This sort of thing might work well for smaller projects, but as you can imagine, it doesn't scale particulary well. Another approach would be to implement something like a Query Object (POEAA 316). That is, "...a structure of objects that can form itself into a SQL query". That way, you can do things like: query = createObject() query.addCriteria(someCriteria) query.addCritieria(someOtherCriteria) query.addCritieria(nestedCriteria) personGateway.update(query) or maybe, personGateway.delete(query) This is a huge oversimplification of the the work necessary to implement this kind of pattern successfully. As Mr. Fowler says in the "When To Use It", it really relies on the existence of Domain Model (POEAA 116), Data Mapper (POEAA 165), and Metadata Mapping (POEAA 306) to be effective. -dante ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). CFCDev is supported by New Atlanta, makers of BlueDragon http://www.newatlanta.com/products/bluedragon/index.cfm An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
