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 EE95A200B76 for ; Tue, 30 Aug 2016 13:35:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id ECF07160ABA; Tue, 30 Aug 2016 11:35:46 +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 3ED2B160AA8 for ; Tue, 30 Aug 2016 13:35:46 +0200 (CEST) Received: (qmail 56493 invoked by uid 500); 30 Aug 2016 11:35:45 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 56482 invoked by uid 99); 30 Aug 2016 11:35:45 -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; Tue, 30 Aug 2016 11:35:45 +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 C577F1A01A6 for ; Tue, 30 Aug 2016 11:35:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.299 X-Spam-Level: X-Spam-Status: No, score=0.299 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id zcDF1vr6tL8R for ; Tue, 30 Aug 2016 11:35:43 +0000 (UTC) Received: from mail-03.1984.is (mail-03.1984.is [93.95.224.70]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 8DDC85FAEE for ; Tue, 30 Aug 2016 11:35:42 +0000 (UTC) Received: from localhost by mail-03.1984.is with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84_2) (envelope-from ) id 1behKJ-0002m0-1h for user@cayenne.apache.org; Tue, 30 Aug 2016 11:35:35 +0000 From: Hugi Thordarson Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: EJBQL weirdness Message-Id: <622C0864-EACA-4011-8C9B-C0BAEF9E022F@karlmenn.is> Date: Tue, 30 Aug 2016 11:35:33 +0000 To: user@cayenne.apache.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) archived-at: Tue, 30 Aug 2016 11:35:47 -0000 Hi all. I=E2=80=99m encountering some weirdness when running EJBQLQuery. = Consider the following code: EJBQLQuery q =3D new EJBQLQuery( "select i.unitPrice,i.quantity = from InvoiceLine i where i.companyNumber=3D'0100008338'" ); List fetchedRows =3D objectContext.performQuery( q ); System.out.println( "Size of resulting list: " + = fetchedRows.size() ); System.out.println( "Class of fetched objects: " + = fetchedRows.get( 0 ).getClass() ); This generates the following output: - --- transaction started. - SELECT t0.unit_price AS sc0, t0.quantity AS sc1 FROM = bok_invoice_line t0 WHERE t0.company =3D ? [bind: 1:'0100008338'] - =3D=3D=3D returned 508 rows. - took 72 ms. - +++ transaction committed. Size of resulting list: 200 Class of fetched objects: class [Ljava.lang.Object; As you can see, the SQL is correct, and the debug log shows that the DB = returns the expected number of 508 objects. However, the resulting List = will only contain 200 objects. This number will then go on to change in = weird ways if I modify the query, for example if I add a third attribute = to fetch, the List will suddenly contain 204 objects=E2=80=94and that = number may change based on which attribute I added. Quite odd, and = I=E2=80=99ve not been able to identify any rule to how it happens. Now, for the second level of weirdness: If I change the query to fetch = data rows (by invoking setFetchingDataRows( true )), the list will end = up containing the correct number of rows. But they will still be = Object[] but not DataRows. - --- transaction started. - SELECT t0.unit_price AS sc0, t0.quantity AS sc1 FROM = bok_invoice_line t0 WHERE t0.company =3D ? [bind: 1:'0100008338'] - =3D=3D=3D returned 508 rows. - took 64 ms. - +++ transaction committed. Size of resulting list: 508 Class of fetched objects: class [Ljava.lang.Object; Any idea what=E2=80=99s happening? Thought I=E2=80=99d ask before I = start digging around. Cheers, - hugi=