Return-Path: X-Original-To: apmail-cayenne-dev-archive@www.apache.org Delivered-To: apmail-cayenne-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8939417A9C for ; Thu, 9 Oct 2014 19:13:51 +0000 (UTC) Received: (qmail 24691 invoked by uid 500); 9 Oct 2014 19:13:51 -0000 Delivered-To: apmail-cayenne-dev-archive@cayenne.apache.org Received: (qmail 24665 invoked by uid 500); 9 Oct 2014 19:13:51 -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 24645 invoked by uid 99); 9 Oct 2014 19:13:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Oct 2014 19:13:51 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mkienenb@gmail.com designates 209.85.217.182 as permitted sender) Received: from [209.85.217.182] (HELO mail-lb0-f182.google.com) (209.85.217.182) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Oct 2014 19:13:25 +0000 Received: by mail-lb0-f182.google.com with SMTP id z11so1718345lbi.41 for ; Thu, 09 Oct 2014 12:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=q63UmyMoCDS6al/qDuGZc1H1htGRatcn7woH9TQNKxw=; b=eARwVBfcvmzSgef+feWl8qHJLA3um7EmFUSoaIgDJhavNSksaT14oRzpUODucckcRa GakkGVulux2FfxRD6OWG+1YP330Qd7/QavVmw+Y8XjTTiraEC2sHxoT4XUlPbDekArgG QBkaKVYewBKXrECB45eV2f/DFoeTJ+ekgUu3krt34FmUj0TaFvNHJyDU/plQ4Kx2jdC2 xWc72k02a1EfT9Sx7iq178ohT+NsH9cjMcB0lKpt+432LGHCfBd1m79A9Sodd2kunV6K RqN+ldqPvZCFL47eB9N7XEyVo4RIVvgBTwTjM74qz+SOAHx5uDnc8EVk3rY1SLFrjWtD b3yg== X-Received: by 10.152.170.194 with SMTP id ao2mr20564934lac.78.1412882005110; Thu, 09 Oct 2014 12:13:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.208.18 with HTTP; Thu, 9 Oct 2014 12:13:05 -0700 (PDT) In-Reply-To: References: <4C8D7FB8-12BC-402E-97EE-31F2F02064B3@objectstyle.org> <54346CCB.9030604@maniatis.org> <66FF37EE-3665-4DD9-821F-91A7349DD0A9@objectstyle.org> From: Mike Kienenberger Date: Thu, 9 Oct 2014 15:13:05 -0400 Message-ID: Subject: Re: Chainable SelectQuery To: dev@cayenne.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org I wonder if QueryBuilder is a better approach which would preserve backwards compatibility. On Thu, Oct 9, 2014 at 3:08 PM, Michael Gentry wrot= e: > Yeah, I don't know if changing setXyz to *not* return 'void' would > break things (like Tapestry). That would be a huge downer. > > On Thu, Oct 9, 2014 at 3:03 PM, Andrus Adamchik = wrote: >> I thought of that. Unfortunately "setXyz" is a 'java bean' setter, so we= 'll be redefining one of the most established Java conventions. >> >> Andrus >> >> On Oct 9, 2014, at 2:51 PM, Michael Gentry wrote= : >> >>> I don't know if it will be confusing or not. At least with the >>> current method names, I can type query.set[ctrl+space] and let Eclipse >>> give me a list of set* method names to choose from (same applies for >>> get*), but that option won't be available with the new chainable API. >>> Part of me thinks just make setFetchLimit() return 'this' (at least >>> where it makes sense to preserve existing API): >>> >>> query.setFetchLimit(100).setDistinct(true); >>> >>> You could continue that in the model objects, too: >>> >>> person.setFirstName("John").setLastName("Doe"); >>> >>> mrg >>> >>> >>> On Thu, Oct 9, 2014 at 1:31 PM, Andrus Adamchik wrote: >>>> >>>> On Oct 7, 2014, at 9:30 PM, Michael Gentry wro= te: >>>> >>>>> On Tue, Oct 7, 2014 at 6:44 PM, Aristedes Maniatis = wrote: >>>>>>> That said, if returning this is the direction we're going, then rea= lly all >>>>>>> the currently void methods in SelectQuery should do the same thing = - like >>>>>>> addOrdering for example. >>>>>> >>>>>> >>>>>> Correct, but we also need to gracefully deprecate the old methods an= d make new fluent ones. >>>>> >>>>> I was looking at the changes and was wondering if we really need to >>>>> deprecate the old methods. Can't setFetchLimit() live along with >>>>> limit()? >>>> >>>> I suspect having both will be rather confusing. Initially I even wante= d to leave SelectQuery alone and implement all the new ideas in a separate = query class (ObjectQuery?), but since we've already made a bunch of changes= to SelectQuery in the same direction, I ended up with a massive change to = the existing class. >>>> >>>> Andrus >>>> >>> >>