Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 75491 invoked from network); 23 Jul 2008 14:05:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jul 2008 14:05:58 -0000 Received: (qmail 25601 invoked by uid 500); 23 Jul 2008 14:05:52 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 25560 invoked by uid 500); 23 Jul 2008 14:05:52 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 25522 invoked by uid 99); 23 Jul 2008 14:05:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jul 2008 07:05:52 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jul 2008 14:05:06 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A80BB234C171 for ; Wed, 23 Jul 2008 07:05:31 -0700 (PDT) Message-ID: <1807728930.1216821931673.JavaMail.jira@brutus> Date: Wed, 23 Jul 2008 07:05:31 -0700 (PDT) From: "Pinaki Poddar (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Assigned: (OPENJPA-662) Version field returns null when explicitly projected in SELECT clause In-Reply-To: <799762876.1216321296229.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pinaki Poddar reassigned OPENJPA-662: ------------------------------------- Assignee: Pinaki Poddar > Version field returns null when explicitly projected in SELECT clause > --------------------------------------------------------------------- > > Key: OPENJPA-662 > URL: https://issues.apache.org/jira/browse/OPENJPA-662 > Project: OpenJPA > Issue Type: Bug > Components: query > Reporter: Dinkar Rao > Assignee: Pinaki Poddar > Priority: Minor > > With this entity: > An entity has a version field, with AUTO strategy. > @Entity > public class Department { > @Id > private int id; > > @Version > @GeneratedValue(strategy=GenerationType.AUTO) > private int myVersion; > > private String name; > } > A record is inserted... > Department d = new Department(); > d.setName("SALES"); > em.getTransaction().begin(); > em.persist(d); > em.getTransaction().commit(); > em.close(); > ...and queried. > If the select is over the entity, "SELECT d from Department d", the version field is set up correctly in the returned entity. > But if the version field is explicitly projected, "SELECT d.id, d.myVersion, d.name from Department d", the id and the name values are returned fine, but the myVersion value is null. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.