Return-Path: X-Original-To: apmail-openjpa-users-archive@minotaur.apache.org Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 02574E13F for ; Tue, 12 Feb 2013 14:30:35 +0000 (UTC) Received: (qmail 28526 invoked by uid 500); 12 Feb 2013 14:30:34 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 28485 invoked by uid 500); 12 Feb 2013 14:30:34 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 28467 invoked by uid 99); 12 Feb 2013 14:30:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2013 14:30:34 +0000 X-ASF-Spam-Status: No, hits=2.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of curtisr7@gmail.com designates 209.85.214.170 as permitted sender) Received: from [209.85.214.170] (HELO mail-ob0-f170.google.com) (209.85.214.170) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2013 14:30:29 +0000 Received: by mail-ob0-f170.google.com with SMTP id wc20so126221obb.29 for ; Tue, 12 Feb 2013 06:30:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=lnOxURdwJ4BhtfeUZfe45dYKre061YV/310lGJEIU8k=; b=NF0JE9bsJwRKr1fPVbp+MaPpOIvHc+HY9ZgIqke9pyRx3izRzr2DqRC7xYKb0X9a40 dMFplm8bk5wnR0U95blg4qEsD+U/JcGq66fOUBiYcAJhxx3fsPBSnvZKJmkJGRFyyC3P 28JDug8fZiknDnJE/fp5wDKW5PG5G91N8arPkmTMlZA59+PWb47OkCanaKmQwLttwUbW pYyiJOGCDJuaXHkfOHI919ZRCJz7BhPMQzRurD3oKycQ1AW0KczYkfwFO9E8LIXw0zt8 mkplwXDLZ7bQKS6IipBZJwscSZL5tACLC9OlKATIR1NA/UzxxiZw9dd46n2p5aEChNxg DpKg== MIME-Version: 1.0 X-Received: by 10.182.182.68 with SMTP id ec4mr13375922obc.26.1360679408719; Tue, 12 Feb 2013 06:30:08 -0800 (PST) Received: by 10.60.2.133 with HTTP; Tue, 12 Feb 2013 06:30:08 -0800 (PST) In-Reply-To: References: Date: Tue, 12 Feb 2013 08:30:08 -0600 Message-ID: Subject: Re: OpenJPA has issues with table name "user" and Apache Derby database From: Rick Curtis To: users@openjpa.apache.org Content-Type: multipart/alternative; boundary=14dae9399547cf573b04d587dc11 X-Virus-Checked: Checked by ClamAV on apache.org --14dae9399547cf573b04d587dc11 Content-Type: text/plain; charset=ISO-8859-1 Sebastian - Yes, I believe this is a bug. That being said, there might be already support for enabling escaping / delimiting table names in DBDictionary... I'd look myself, but I don't have a dev environment on this machine. Let us know what you find out. Thanks, Rick On Mon, Feb 11, 2013 at 1:35 AM, seba.wagner@gmail.com < seba.wagner@gmail.com> wrote: > I might be willing to look into the OpenJPA source code to find out the > root of the issue, > but it would be good if somebody could confirm that this is a bug that > needs to be fixed. > > Sebastian > > > 2013/2/10 seba.wagner@gmail.com > > > Btw: The same issue exists with Postgres. We can't choose a table name > > "user" cause the SQL is not quoted in the sql for string "user". > > > > Sebastian > > > > > > 2013/2/10 seba.wagner@gmail.com > > > > Yes, > >> > >> actually you have those reserved keywords in all database. A subset of > >> those is common across all, some are special in each. > >> But of course it does not mean that those strings are "forbidden" to > use. > >> It simply means you have to escape them! (Or double quoting as the link > >> to the derby 10.8 docs say). > >> > >> For example the word "open" is also a reserved keyword according to the > >> list. But of course you can name a column "open" in OpenJPA, because it > is > >> somehow correctly escaped when the SQL is generated. "user" seems to be > not > >> correctly escaped. That is the problem. > >> > >> Sebastian > >> > >> > >> > >> 2013/2/10 Maxim Solodovnik > >> > >>> Hello Jesse, > >>> Thanks for the link! > >>> > >>> Is there any option to tell OpenJPA to generate derby compatible SQL? > >>> > >>> > >>> On Sat, Feb 9, 2013 at 8:11 PM, Jesse Farinacci > >>> wrote: > >>> > >>> > Greetings, > >>> > > >>> > On Sat, Feb 9, 2013 at 12:15 AM, seba.wagner@gmail.com > >>> > wrote: > >>> > > we face an issue with OpenJPA 2.2.1 and Derby 10.8.2.2. > >>> > > When there is a table "user" the schema is correctly created > >>> > > with SynchronizeMappings. > >>> > > > >>> > > However making a query in the that database results in: > >>> > > org.apache.openjpa.persistence.PersistenceException: Syntax error: > >>> > > Encountered "user" at line 1, column 888. > >>> > > >>> > http://db.apache.org/derby/docs/10.8/ref/rrefkeywords29722.html > >>> > > >>> > -Jesse > >>> > > >>> > -- > >>> > There are 10 types of people in this world, those > >>> > that can read binary and those that can not. > >>> > > >>> > >>> > >>> > >>> -- > >>> WBR > >>> Maxim aka solomax > >>> > >> > >> > >> > >> -- > >> Sebastian Wagner > >> https://twitter.com/#!/dead_lock > >> http://www.webbase-design.de > >> http://www.wagner-sebastian.com > >> seba.wagner@gmail.com > >> > > > > > > > > -- > > Sebastian Wagner > > https://twitter.com/#!/dead_lock > > http://www.webbase-design.de > > http://www.wagner-sebastian.com > > seba.wagner@gmail.com > > > > > > -- > Sebastian Wagner > https://twitter.com/#!/dead_lock > http://www.webbase-design.de > http://www.wagner-sebastian.com > seba.wagner@gmail.com > -- *Rick Curtis* --14dae9399547cf573b04d587dc11--