openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob Nowosatka (JIRA)" <>
Subject [jira] [Updated] (OPENJPA-2045) NAME is a valid column name for H2 databases.
Date Wed, 14 Sep 2011 21:18:11 GMT


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.

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:
>             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 :

> 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:


View raw message