Return-Path: X-Original-To: apmail-cayenne-commits-archive@www.apache.org Delivered-To: apmail-cayenne-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C2A3C10476 for ; Fri, 10 Jan 2014 06:46:56 +0000 (UTC) Received: (qmail 20626 invoked by uid 500); 10 Jan 2014 06:46:56 -0000 Delivered-To: apmail-cayenne-commits-archive@cayenne.apache.org Received: (qmail 20605 invoked by uid 500); 10 Jan 2014 06:46:51 -0000 Mailing-List: contact commits-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 commits@cayenne.apache.org Received: (qmail 20591 invoked by uid 99); 10 Jan 2014 06:46:50 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jan 2014 06:46:50 +0000 Date: Fri, 10 Jan 2014 06:46:50 +0000 (UTC) From: "Andrus Adamchik (JIRA)" To: commits@cayenne.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAY-1796) ROP: All entity's to-many relationships getting faulted from database when using it as a parameter in qualifier expression. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAY-1796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13867565#comment-13867565 ] Andrus Adamchik commented on CAY-1796: -------------------------------------- [~olegart] IMO the idea is correct. We need to write unit tests for it though. I think there may be some Expression structures where object argument is not wrapped in ASTScalar. So we need to test these cases: * Expression created via ExpressionFactory methods * Expression created via Expression.expWithParameters(..) * Expressions where parameters are passed as collections (e.g. "IN" expression). > ROP: All entity's to-many relationships getting faulted from database when using it as a parameter in qualifier expression. > --------------------------------------------------------------------------------------------------------------------------- > > Key: CAY-1796 > URL: https://issues.apache.org/jira/browse/CAY-1796 > Project: Cayenne > Issue Type: Bug > Components: ROP > Affects Versions: 3.1B2 > Reporter: Dzmitry Kazimirchyk > Fix For: 3.1B3 > > Attachments: cay1796.patch, cay1796_2.patch > > > If entity is used as a parameter in qualifier expression all its unfaulted to-many relationships are faulted prior to actual query sent to server. For example: > Expression exp = ExpressionFactory.matchExp(Painting.ARTIST_PROPERTY, artist); > context.performQuery(new SelectQuery(Painting.class, exp)); > Before actual query will be sent to server all artist's to-many relationships will be faulted. What I see is that in the process of query serialization on client side PersistentObjectList.size() is invoked which triggers relationships' faulting from database. -- This message was sent by Atlassian JIRA (v6.1.5#6160)