Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 20288 invoked from network); 12 Oct 2010 18:31:56 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Oct 2010 18:31:56 -0000 Received: (qmail 37870 invoked by uid 500); 12 Oct 2010 18:31:56 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 37731 invoked by uid 500); 12 Oct 2010 18:31:56 -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 37723 invoked by uid 99); 12 Oct 2010 18:31:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Oct 2010 18:31:56 +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, 12 Oct 2010 18:31:55 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o9CIVZch028079 for ; Tue, 12 Oct 2010 18:31:35 GMT Message-ID: <30927095.100691286908295616.JavaMail.jira@thor> Date: Tue, 12 Oct 2010 14:31:35 -0400 (EDT) From: "Donald Woods (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Work started: (OPENJPA-1818) SQL-Syntax errors with h2 In-Reply-To: <247731.460521285756832386.JavaMail.jira@thor> 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-1818?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Work on OPENJPA-1818 started by Donald Woods. > SQL-Syntax errors with h2 > ------------------------- > > Key: OPENJPA-1818 > URL: https://issues.apache.org/jira/browse/OPENJPA-1818 > Project: OpenJPA > Issue Type: Bug > Components: sql > Affects Versions: 2.0.0 > Environment: h2 Version: 1.2.124 > Reporter: Stefan Wokusch > Assignee: Donald Woods > Fix For: 2.1.0 > > Attachments: OPENJPA-1818.diff > > > I have an Entity with an attribute named "order". While creating the table for the Entity there is thrown an error. Renaming the "order"-attribute fixed this error. > Ill tested this with MySql and H2. With Mysql the "order"-attribute was no problem, h2 thrown that error. > I dont know where the exact problem is, ill hope im right here :) > Workarround: > Rename the attribute. > Here the Stacktrace: > Caused by: org.apache.openjpa.persistence.PersistenceException: Syntax Fehler in SQL Befehl "CREATE TABLE TABBARITEMENTITY (ID INTEGER NOT NULL, ORDER[*] INTEGER, REF VARCHAR(255), TEXT VARCHAR(255), PRIMARY KEY (ID)) "; erwartet "identifier" > Syntax error in SQL statement "CREATE TABLE TABBARITEMENTITY (ID INTEGER NOT NULL, ORDER[*] INTEGER, REF VARCHAR(255), TEXT VARCHAR(255), PRIMARY KEY (ID)) "; expected "identifier"; SQL statement: > CREATE TABLE TabbarItemEntity (id INTEGER NOT NULL, order INTEGER, ref VARCHAR(255), text VARCHAR(255), PRIMARY KEY (id)) [42001-124] {stmnt 20639876 > CREATE TABLE TabbarItemEntity (id INTEGER NOT NULL, order INTEGER, ref > VARCHAR(255), text VARCHAR(255), PRIMARY KEY (id)) } [code=42001, state=42001] > at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:556) > at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:456) > at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:155) > at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:159) > at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:117) > at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:199) > at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156) > at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:213) > at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:151) > at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:57) > at de.joe.core.server.config.ModulePersistenceApiOpenJPA.configure(ModulePersistenceApiOpenJPA.java:48) > at com.google.inject.AbstractModule.configure(AbstractModule.java:59) > at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223) > at com.google.inject.spi.Elements.getElements(Elements.java:101) > at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:135) > at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:114) > ... 22 more > Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Syntax Fehler in SQL Befehl "CREATE TABLE TABBARITEMENTITY (ID INTEGER NOT NULL, ORDER[*] INTEGER, REF VARCHAR(255), TEXT VARCHAR(255), PRIMARY KEY (ID)) "; erwartet "identifier" > Syntax error in SQL statement "CREATE TABLE TABBARITEMENTITY (ID INTEGER NOT NULL, ORDER[*] INTEGER, REF VARCHAR(255), TEXT VARCHAR(255), PRIMARY KEY (ID)) "; expected "identifier"; SQL statement: > CREATE TABLE TabbarItemEntity (id INTEGER NOT NULL, order INTEGER, ref VARCHAR(255), text VARCHAR(255), PRIMARY KEY (id)) [42001-124] {stmnt 20639876 > CREATE TABLE TabbarItemEntity (id INTEGER NOT NULL, order INTEGER, ref > VARCHAR(255), text VARCHAR(255), PRIMARY KEY (id)) } [code=42001, state=42001] > at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:257) > at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:241) > at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:70) > at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingStatement.executeUpdate(LoggingConnectionDecorator.java:951) > at org.apache.openjpa.lib.jdbc.DelegatingStatement.executeUpdate(DelegatingStatement.java:136) > at org.apache.openjpa.jdbc.schema.SchemaTool.executeSQL(SchemaTool.java:1200) > at org.apache.openjpa.jdbc.schema.SchemaTool.createTable(SchemaTool.java:956) > at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:533) > at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:348) > at org.apache.openjpa.jdbc.schema.SchemaTool.run(SchemaTool.java:325) > at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:504) > ... 37 more -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.