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 B7DE8200C28 for ; Mon, 13 Mar 2017 09:27:03 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B662A160B6C; Mon, 13 Mar 2017 08:27:03 +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 DB4FC160B60 for ; Mon, 13 Mar 2017 09:27:02 +0100 (CET) Received: (qmail 62789 invoked by uid 500); 13 Mar 2017 08:27:00 -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 62771 invoked by uid 99); 13 Mar 2017 08:27:00 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Mar 2017 08:27:00 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 90017C6CAD for ; Mon, 13 Mar 2017 08:26:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.821 X-Spam-Level: X-Spam-Status: No, score=-0.821 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=objectstyle.org header.b=hBp0ePkv; dkim=pass (1024-bit key) header.d=messagingengine.com header.b=XuZOqLXD Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id DCnjAms1xGxw for ; Mon, 13 Mar 2017 08:26:58 +0000 (UTC) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 2174B5F397 for ; Mon, 13 Mar 2017 08:26:58 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 641A12074D for ; Mon, 13 Mar 2017 04:26:55 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Mon, 13 Mar 2017 04:26:55 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=objectstyle.org; h=content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=BFujoVs1E1Ybsqc 8R1Ym1xLMtic=; b=hBp0ePkv+xScT9ykq2KNhwzRO9m/4kooS4n/JVicaMRJO4+ m/V+zFRfWTj1pN2t4NQ7cbLQXLbJ34ZcRIaaciyaP6jhED6cJ811CMZhOwJ1WSMn 801WII7whRm6bbfCopX+l9ro74o/+5erH0YNm8/aUKMgeZAVbb65uGWMbpfE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=BFujoVs1E1Ybsqc8R1Ym1xLMtic=; b=XuZOqLXDyX5Ei031kLO/ nQFv1Tno1fzKnxiho2f3JQ9SPtzbBj27DCVehijBEnTPAYSv3wzfP0bxON64b3yK JT3AGakadeangsPDwi3roJwAmAg+P+rY/UI7A7MX96sXdiQ2nxgYBJ+wHMRMz1Hi BzaTEhliiR/DsYAcP0StFdA= X-ME-Sender: X-Sasl-enc: 8A5heWKZyV78LsDJOYpPRdDoY8b2NM9F3WXcJ7TtxDCH 1489393615 Received: from [192.168.1.73] (unknown [37.17.49.228]) by mail.messagingengine.com (Postfix) with ESMTPA id DFA9B2448D for ; Mon, 13 Mar 2017 04:26:54 -0400 (EDT) From: Andrus Adamchik Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: ColumnSelect API + Persistent objects Date: Mon, 13 Mar 2017 11:26:53 +0300 References: <9978ec72-3033-9675-4434-21c28e6bc5b3@maniatis.org> To: dev@cayenne.apache.org In-Reply-To: <9978ec72-3033-9675-4434-21c28e6bc5b3@maniatis.org> Message-Id: <8EAE441C-5264-49DF-BFA1-07AACFECF709@objectstyle.org> X-Mailer: Apple Mail (2.3259) archived-at: Mon, 13 Mar 2017 08:27:03 -0000 > Oh, I get it now. You are suggesting in option (2) that Cayenne = creates a CROSS JOIN in sql. Actually not a CROSS join. It will be a regular INNER JOIN based on = relationship from the query root. JPA spec defines CROSS join = operations. We don't (yet?). > Sometimes you want to fetch specific columns as read-only for = performance reasons. I get that. You save on fetching data and you save = time on constructing full ObjEntities. Yep. A typical use case for intermixing DataObjects and scalars in the = result is this: [, ] that gives us each = object's to-many counts without resolving to-many relationships. What I = am unsure though is whether [, ] result is of any = use to anyone. > Are users going to be confused that the ObjEntities are bound to a = context and editable/committable, but the raw columns are not? I am not concerned about this. I think everyone should understand that = only DataObjects can be committed. Any other representations is = non-updateable data. Andrus > On Mar 13, 2017, at 10:29 AM, Aristedes Maniatis = wrote: >=20 > On 13/3/17 5:57pm, Andrus Adamchik wrote: >>=20 >>>>>=20 >>>>> List result =3D ObjectSelect.query(Artist.class) >>>>> .columns(Artist.ARTIST_NAME, Artist.PAINTING_ARRAY) >>>>> .select(context); >>=20 >>=20 >>>> For me it's not clear when do we need direct List result for toMany >>>> relationship instead of using Prefetch (or even selecting related >>>> entities explicitly). >>=20 >> Let's ponder on this some more. In the example above there are two = possible result mappings of to-many - each cell at index 1 can store = either (1) a List or (2) a Painting. Of course in the second = case Artist name at index 0 will be repeated for each painting of a = given Artist (so the result is flattened).=20 >>=20 >> In the proposed solution we throw in the first case and support the = second. I'd like to hear opinions on the usefulness of either of the = cases, and maybe some real life examples. >=20 >=20 > Oh, I get it now. You are suggesting in option (2) that Cayenne = creates a CROSS JOIN in sql. >=20 > Surely most of the time we are steering users to creating ObjEntities = where possible; then they have the full access to follow relations, = prefetching, pagination, etc, etc. >=20 > Sometimes you want to fetch specific columns as read-only for = performance reasons. I get that. You save on fetching data and you save = time on constructing full ObjEntities. But then why would you want to = embed full ObjEntities in the result? Any performance benefits are = surely out the window. So what's the point and the use-case? >=20 >=20 >=20 > Are users going to be confused that the ObjEntities are bound to a = context and editable/committable, but the raw columns are not? >=20 > result.get(0)[3][1].setName("The scream") > result.get(0)[2] =3D "Munch" > context.commit() >=20 >=20 >=20 > What is the output of this: >=20 > result =3D ObjectSelect.query(Artist.class) > .columns(createSelf(Artist.class)) > .select(context); >=20 > Is that the same as=20 >=20 > result =3D ObjectSelect.query(Artist.class) > .select(context); >=20 > would the generated SQL be the same? >=20 > Ari >=20 >=20 >=20 >=20 > --=20 > --------------------------> > Aristedes Maniatis > GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A