From dev-return-19535-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 14 21:18:33 2011 Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 11E597337 for ; Wed, 14 Sep 2011 21:18:33 +0000 (UTC) Received: (qmail 21113 invoked by uid 500); 14 Sep 2011 21:18:32 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 21088 invoked by uid 500); 14 Sep 2011 21:18:32 -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 21077 invoked by uid 99); 14 Sep 2011 21:18:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Sep 2011 21:18:32 +0000 X-ASF-Spam-Status: No, hits=-1999.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD,URI_HEX X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Sep 2011 21:18:31 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 602CB99AD6 for ; Wed, 14 Sep 2011 21:18:11 +0000 (UTC) Date: Wed, 14 Sep 2011 21:18:11 +0000 (UTC) From: "Jacob Nowosatka (JIRA)" To: dev@openjpa.apache.org Message-ID: <578786545.28315.1316035091389.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <18906462.6769.1314885849842.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (OPENJPA-2045) NAME is a valid column name for H2 databases. 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-2045?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacob Nowosatka updated OPENJPA-2045: ------------------------------------- Attachment: OPENJPA-2045.patch I did some research and it seems that for only a few databases is "NAME" as a reserved keyword. Access FoxPro Informix Pointbase Thus, I have opted to remove "NAME" from the list of common reserved words and made it specific to each database listed above. The attached patch does just this. > NAME is a valid column name for H2 databases. > --------------------------------------------- > > Key: OPENJPA-2045 > URL: https://issues.apache.org/jira/browse/OPENJPA-2045 > Project: OpenJPA > Issue Type: Bug > Components: jdbc > Affects Versions: 2.1.0, 2.2.0 > Reporter: Michael Dick > Priority: Minor > Attachments: OPENJPA-2045.patch > > > This issue was originally reported on the users mailing list : http://openjpa.208410.n2.nabble.com/GenerationType-TABLE-question-column-name-suffixed-with-0-td6729676.html. > The H2 DBDictionary is picking up the default list of invalid column names from openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-keywords.rsrc, which includes "NAME". As a result we're trying to fix the column so that it contains a valid identifier, and end up with the wrong value. > Users can work around the problem by delimiting columns in their annotations or xml mapping files, for example : > @javax.persistence.TableGenerator( > name = "fred", > table = "jpa_sequence", > pkColumnName = "\"name\"", > valueColumnName = "last_value", > pkColumnValue = "fred", > allocationSize = 500) > To fix the problem we need to either remove NAME from the default list, or manually remove it in the H2 Dictionary. Some additional investigation may be needed to determine whether this is a problem for other databases too. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira