Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 6986 invoked from network); 21 Sep 2010 17:10:55 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Sep 2010 17:10:55 -0000 Received: (qmail 62720 invoked by uid 500); 21 Sep 2010 17:10:55 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 62564 invoked by uid 500); 21 Sep 2010 17:10:54 -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 62556 invoked by uid 99); 21 Sep 2010 17:10:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Sep 2010 17:10:54 +0000 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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Sep 2010 17:10:53 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8LHAWsA018899 for ; Tue, 21 Sep 2010 17:10:33 GMT Message-ID: <13020260.320331285089032504.JavaMail.jira@thor> Date: Tue, 21 Sep 2010 13:10:32 -0400 (EDT) From: "Fay Wang (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-1582) @OrderColumn(updatable=false) may have the order column field updated In-Reply-To: <260602145.343181268924187482.JavaMail.jira@brutus.apache.org> 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/OPENJPA-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913085#action_12913085 ] Fay Wang commented on OPENJPA-1582: ----------------------------------- According to Section 11.1.39 of JPA 2.0 spec: OrderColumnAnnotation Element "updatable" means: (Optional) Whether the column is included in SQL UPDATE statements generated by the persistence provider Also in the same section: The order column must be of integral type. The persistence provider must maintain a contiguous (non-sparse) ordering of the values of the order column when updating the association or element collection. The order column value for the first element of the list must be 0. Two scenarios when an element collection is updated: (1) a new element is added: OpenJPA will execute an insert statement (2) an old element is removed: OpenJPA will perform delete/insert For scenario (2), the operation is working as design in order to preserver the contiguous ordering of the values of the order column. In addition, no "UPDATE" statement is issued in this operation, which is consistent with what the spec says. > @OrderColumn(updatable=false) may have the order column field updated > --------------------------------------------------------------------- > > Key: OPENJPA-1582 > URL: https://issues.apache.org/jira/browse/OPENJPA-1582 > Project: OpenJPA > Issue Type: Bug > Components: jdbc > Affects Versions: 2.0.0-beta2 > Reporter: Albert Lee > Priority: Minor > > When a collection with orderColumn set updatable=false, > @ElementCollection//(fetch=FetchType.EAGER) > @OrderColumn(updatable=false) > private List nonUpdableAnnotatedElements; > when collection element is updated, the order column processing performs a delete/insert sequence. The problem is that the implicit order column field is also updated while updatable=false. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.