Return-Path: Delivered-To: apmail-cayenne-dev-archive@www.apache.org Received: (qmail 71930 invoked from network); 2 Jun 2009 09:09:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Jun 2009 09:09:11 -0000 Received: (qmail 75498 invoked by uid 500); 2 Jun 2009 09:09:23 -0000 Delivered-To: apmail-cayenne-dev-archive@cayenne.apache.org Received: (qmail 75460 invoked by uid 500); 2 Jun 2009 09:09:22 -0000 Mailing-List: contact dev-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list dev@cayenne.apache.org Received: (qmail 75450 invoked by uid 99); 2 Jun 2009 09:09:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jun 2009 09:09:22 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of razumovsky.andrey@gmail.com designates 209.85.219.180 as permitted sender) Received: from [209.85.219.180] (HELO mail-ew0-f180.google.com) (209.85.219.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jun 2009 09:09:14 +0000 Received: by ewy28 with SMTP id 28so9720590ewy.4 for ; Tue, 02 Jun 2009 02:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=6LSnntiw9eaNAH6ac7Y1Xj3DpivsE3tHIQT4FPJ6MA0=; b=DrBWNRFVBi6oUryc6Quxn11lMg1xSmLLtcdUqMuLTjwb4nqSRbHhlHbuCRnt1Xhskn /fVNHAxW6TsphN3zG5ojs5MiOPIIKUFiY81p26RgTlKRexIDSgOLBlq5bm0gg0tU17b9 becWVEmNlfcVALa1/PBTblWmDAnsdTnbMtEds= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=KpfD/iBQ31BbfbwaeSfzUVCaLc54TDO0vj8MJERKtztHUwDBq+jKOZXuPvBaIVg3i8 Q57aVflKLEKhs+Xe+xeLZvqUr5JThBhN55qvIdr9f5tyMHgPmbzCb19aLZ+JBSZO8g0T 2m25OwIFMLQMMipoLF5zrTk6lsTaTTc09zDjA= MIME-Version: 1.0 Received: by 10.216.36.84 with SMTP id v62mr2178785wea.128.1243933733173; Tue, 02 Jun 2009 02:08:53 -0700 (PDT) In-Reply-To: <1C3898BB-1930-431B-B8DA-6732947356C3@objectstyle.org> References: <3219fff70906010809lb53131age67e865246947f90@mail.gmail.com> <1C3898BB-1930-431B-B8DA-6732947356C3@objectstyle.org> Date: Tue, 2 Jun 2009 13:08:53 +0400 Message-ID: <3219fff70906020208q12c840a2t55ce02e9765852c7@mail.gmail.com> Subject: Re: Non-physical delete... again From: Andrey Razumovsky To: dev@cayenne.apache.org Content-Type: multipart/alternative; boundary=001636499f5b4a3b7f046b59e4da X-Virus-Checked: Checked by ClamAV on apache.org --001636499f5b4a3b7f046b59e4da Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, > Back then, we > could set up a delegate to intercept all queries, and I automatically > added the restricting qualifier to each select query. I'm afraid, simple qualifier would not be enough, I need to set them for all joined tables in query (I have simple qualifirer already, by using ObjEntity qualifier). 2009/6/1 Andrus Adamchik > > > On Jun 1, 2009, at 6:09 PM, Andrey Razumovsky wrote: > >> >> >> 2. Deletion strategy for DataDomain. This means I do not always fire >> DeleteAction, but maybe something else (update action in my case). >> > > Yeah, good idea to move this down the stack. I would love to have the > ObjectContext level code to stay unchanged, but then generate UPDATE instead > of DELETE at the lower levels if entity is tagged as "soft delete". I actually want to see this more generic, i.e. DeletionStrategy interface with one default implementation (which fires DELETE) and ability to set my own. > > > 1. DBEntity qualifier. This is same as ObjEntity qualifier, but applied >> every time DBentity is being added to select sql. I will add DBEntity >> qualifier 'deleted=false' and drop current ObjEntity's >> > > So does that mean dropping ObjEntity qualifiers completely? (This may or > may not be a good idea, I am not yet sure myself). I mean removing them in my Cayenne project of course, not in API. > Also I think there's a possibility here to address another annoyance in one > shot - the need to manually set the inheritance discriminator column for new > objects when inheritance is used. If we can add functionality to expressions > to not only "get" the value from an object, but also "set" the value, we can > do both soft delete and auto inheritance update based on an (almost) > arbitrary exception. Kind of like OGNL framework does... > > Well, I agree this is must-have in Cayenne. But my proposed solution is a separate feature, because I need intercepting at DbEntity level. If noone minds against these features, I think I'll look at implementing 'DeleteStrategy' and 'DbEntity qualifiers' Andrey --001636499f5b4a3b7f046b59e4da--