openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dick <michael.d.d...@gmail.com>
Subject Re: GenerationType.TABLE question: column name suffixed with 0?
Date Thu, 01 Sep 2011 13:51:21 GMT
You're right, this is a bug. "NAME" is in the default set of reserved words
that can't be used as column names. It appears to be valid for H2 though and
we should handle it appropriately. Can you file a JIRA issue, or would you
like me to do that on your behalf?

You can escape the name column as a workaround  :
@javax.persistence.TableGenerator(
    name = "fred",
    table = "jpa_sequence",
    pkColumnName = "\"name\"",
    valueColumnName = "last_value",
    pkColumnValue = "fred",
    allocationSize = 500)

-mike

On Fri, Aug 26, 2011 at 1:36 PM, Laird Nelson <ljnelson@gmail.com> wrote:

> On Fri, Aug 26, 2011 at 1:49 PM, Laird Nelson <ljnelson@gmail.com> wrote:
>
> > OpenJPA tries to read a column called "NAME0", which is not defined
> > anywhere.
> >
>
> Changing the name of the sequence table column from "NAME" to
> "SEQUENCE_NAME" fixed the problem.  Bug in OpenJPA, I think.  Maybe in the
> H2 dictionary?
>
> Best,
> Laird
> --
> http://about.me/lairdnelson
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message