Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 32E79200C39 for ; Thu, 16 Mar 2017 09:14:51 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 31853160B7A; Thu, 16 Mar 2017 08:14:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 77ED2160B78 for ; Thu, 16 Mar 2017 09:14:50 +0100 (CET) Received: (qmail 37042 invoked by uid 500); 16 Mar 2017 08:14:49 -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 37029 invoked by uid 99); 16 Mar 2017 08:14:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Mar 2017 08:14:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id DE04D1A00C9 for ; Thu, 16 Mar 2017 08:14:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.132 X-Spam-Level: * X-Spam-Status: No, score=1.132 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_NEUTRAL=0.652] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=objectstyle-com.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id sm2I_EHaaPkz for ; Thu, 16 Mar 2017 08:14:47 +0000 (UTC) Received: from mail-ua0-f177.google.com (mail-ua0-f177.google.com [209.85.217.177]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 77A985FD84 for ; Thu, 16 Mar 2017 08:14:47 +0000 (UTC) Received: by mail-ua0-f177.google.com with SMTP id f54so21798527uaa.1 for ; Thu, 16 Mar 2017 01:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=objectstyle-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=vwFotyq7qST7yGS+bZ4dZneHxtVdrY9+Kd5SuwwRfcM=; b=QuAALrBVs1WejCcXpasLNZQnFSrpXS/iXLAY7SK3b2exkVSSQCYzhRxk/fCbwirVPS Nj+U0C5Cta0Q8KwMjQuZxyOQb2wTYSpFhnalWTgcaS71GvG1i2nehVWn3420DdIE1NxF DA9J/BoWlEQqrZsq5IjFk3idV5v54golzWHsmkQ8MMGiUf4aF12u4x5opb+76bdFvOic Ggc46SZT+1r9WWcrdVQ7QBD315E3Xe9ytD+jCcB5UfOdDrn9JnYuBsTFT/9pdBzmHBtb u2QC51RHNjKLPxr8u0fEofafvaAQwI6i4VCybqA/gSow5tYJyxjv4JLsuFStE+L03BqG LYDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=vwFotyq7qST7yGS+bZ4dZneHxtVdrY9+Kd5SuwwRfcM=; b=bTfD4Nu55LDx9VBM7QAKYbGCPJLumeEOfTRKtPwDYt1bON+8LeaeUKN/Jlqz90hCJg M7JkiOWNx7JogAAs3Zvc/vVL/nGiisYQCtIe9w/Tz9n1cUnkipvlatsu2Przr1ncU4XF 3U9CVPn9zCbNGOQyswm3OlLYp1zaUXJ1aCIayLz5pwHPAMwH+iBIWylo3PtKmfdULuvT 9Hm3/Dlr6jhnotMrf4g7HHexrqkIf4hqj+KG3y/nHwhtxtMC7M1romCQP4jbW1m6wgL9 brkG7Z8AWX6BGi3e9jqIkzO7CWoMmsAZS0MogvkdDc2UfRJfr3EuVlGmTi7ihaVb3VrI N2XQ== X-Gm-Message-State: AFeK/H2QHnkr/eY6RqJE+bJ3v//oVTiNCaNE4UF4g45hG4ByeQXvJLx2zd7sL9lGvHnMfK4TbIoGXJUc46iSFw== X-Received: by 10.176.93.30 with SMTP id u30mr3224360uaf.179.1489652081190; Thu, 16 Mar 2017 01:14:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.39.134 with HTTP; Thu, 16 Mar 2017 01:14:20 -0700 (PDT) In-Reply-To: <0df99a5d-98f5-a440-6be8-b33d45b3f6ae@maniatis.org> References: <9978ec72-3033-9675-4434-21c28e6bc5b3@maniatis.org> <8EAE441C-5264-49DF-BFA1-07AACFECF709@objectstyle.org> <3fc918ed-c32e-e6f0-85a9-4e489d662cb3@maniatis.org> <0df99a5d-98f5-a440-6be8-b33d45b3f6ae@maniatis.org> From: Nikita Timofeev Date: Thu, 16 Mar 2017 11:14:20 +0300 Message-ID: Subject: Re: ColumnSelect API + Persistent objects To: dev@cayenne.apache.org Content-Type: text/plain; charset=UTF-8 archived-at: Thu, 16 Mar 2017 08:14:51 -0000 On Mon, Mar 13, 2017 at 3:05 PM, Aristedes Maniatis wrote: > On 13/3/17 9:53pm, Andrus Adamchik wrote: >> >>> On Mar 13, 2017, at 1:46 PM, Aristedes Maniatis wrote: >>> >>> >>> Just a wild thought, but would this syntax be helpful... >>> >>> List result = ObjectSelect.query(Artist.class) >>> .addColumns(Artist.PAINTING_COUNT) >>> .select(context); >>> >>> So then we are adding more columns to the existing DataObject query rather than having to define the DataObjects as properties in themselves. The syntax above might be simpler to understand and write. >> >> So "addColumns" vs "columns"? IIRC we tried something similar with orderings (override all orderings vs add to the existing orderings), and that confused everybody (including me as the author), so that was undone between the milestones. > > > Except in this case it is very different result since with this syntax you get the mixed columns/DataObject results and avoid needing to create properties for 'self' or some other confusing construct. > I think we can add Property SELF to default cgen templates, then everything will be pretty simple: ObjectSelect .columnQuery(Artist.class, Artist.SELF, Artist.PAINTING_ARRAY.count()) .select(context); -- Best regards, Nikita Timofeev