Re: persistent.delete() ?

Michael Nash <[email protected]> Tue, 24 Aug 2004 11:11:44 -0400
Newsgroups gmane.comp.java.keel.user
Organization JGlobal Limited
Message-ID <[email protected]>
Steve:

On Tue, 2004-08-24 at 11:20, Stephen Davidson wrote:
> Hi Mike.
> 
> Do you know a good doctor for reattaching feet that have been shot off 
> by one's own action? 

No, but I suspect I'd be getting a bulk-discount on that by now myself
:-)

>  I did not think about using a query service for 
> the deletes, and I should have.

I forget about query myself, until I find myself doing all sorts of
contorted things in Persistence that it's really not too good at, then I
remember query...

> OTOH, maybe the default DataStore's can be readily upgraded to handle a 
> "Single Row Delete"?  I would be happy to tackle that one, if it would 
> be a good idea.

Default persistence you mean? Sure, I think it can be added pretty
easily, and probably should be.

I think it's also a bug for it to generate a "delete all" if it has no
criteria!

Mike
> 
> Regards,
> Steve
> 
> Michael Nash wrote:
> 
> >Steve:
> >
> >  
> >
> >>I do object to the Database overhead that your suggestion would entail.
> >>    
> >>
> >
> >If there are many deletes then yes, this would be a lower performance
> >approach. 
> >
> >One problem though is the "and" nature of the query: e.g. if you say:
> >
> >p.setField("oneField", value);
> >p.setField("oneField", value2);
> >
> >and then do (for example) a query, you get just oneField=value2, not
> >value OR value2... 
> >
> >So it should be possible to steal some code from Query to build the
> >where clause for a delete, but you still can't do an "or" without
> >multiple calls.
> >
> >The Query service, OTOH, can do this right now, as you can supply any
> >arbitrary SQL, including deletes as complex as you like.
> >
> >Mike
> >
> >  
> >
>