Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 59705 invoked from network); 1 Mar 2007 19:57:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Mar 2007 19:57:02 -0000 Received: (qmail 69593 invoked by uid 500); 1 Mar 2007 19:57:11 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 69484 invoked by uid 500); 1 Mar 2007 19:57:11 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 69466 invoked by uid 99); 1 Mar 2007 19:57:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Mar 2007 11:57:11 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of plinskey@bea.com designates 66.248.192.22 as permitted sender) Received: from [66.248.192.22] (HELO usremg02.bea.com) (66.248.192.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Mar 2007 11:56:59 -0800 Received: from usremr02.bea.com (mailrelay.bea.com [10.160.29.92]) by usremg02.bea.com (Switch-3.2.2/Switch-3.2.2) with ESMTP id l21JucTh021158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 1 Mar 2007 11:56:38 -0800 Received: from repbex02.amer.bea.com (repbex02.bea.com [10.160.26.99]) by usremr02.bea.com (Switch-3.2.2/Switch-3.2.2) with ESMTP id l21Jq4rD000726 for ; Thu, 1 Mar 2007 11:56:36 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [jira] Updated: (OPENJPA-84) Escape sql reserved words in column names Date: Thu, 1 Mar 2007 11:55:58 -0800 Message-ID: <7D856CDFE035FF45A0420ACBD71BDD63035933B6@repbex02.amer.bea.com> In-Reply-To: <007001c75c38$458a3d40$0500a8c0@kokako> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [jira] Updated: (OPENJPA-84) Escape sql reserved words in column names Thread-Index: AcdboDCAwhAiZCt+RNKnMZso1xPcFwAl8FDwAADh4vA= References: <12178909.1163747557024.JavaMail.jira@brutus> <30637856.1172711931101.JavaMail.jira@brutus> <007001c75c38$458a3d40$0500a8c0@kokako> From: "Patrick Linskey" To: X-PMX-Version: 4.7.1.128075, Antispam-Engine: 2.5.0.283055, Antispam-Data: 2007.2.21.151434 X-Virus-Checked: Checked by ClamAV on apache.org > Can you ask OpenJPA to quote ALL identifiers for a particular > data source? Not currently, but certainly would be useful once we add quoting support. > You might have an identifier (with some databases) that is=20 > declared as "a", but if you access it without quotes in a query > it will be auto-uppercased to A and won't match. You can tell OpenJPA whether or not the database is case-sensitive. This is configured in the DBDictionary, and can be fine-tuned by the user. IOW, you can control whether or not OpenJPA auto-uppercases things. -Patrick --=20 Patrick Linskey BEA Systems, Inc.=20 _______________________________________________________________________ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.=20 > -----Original Message----- > From: Evan Ireland [mailto:eireland@sybase.com]=20 > Sent: Thursday, March 01, 2007 11:32 AM > To: open-jpa-dev@incubator.apache.org > Subject: RE: [jira] Updated: (OPENJPA-84) Escape sql reserved=20 > words in column names >=20 > Patrick, >=20 > Can you ask OpenJPA to quote ALL identifiers for a particular > data source? >=20 > You might have an identifier (with some databases) that is=20 > declared as "a", but if you access it without quotes in a query > it will be auto-uppercased to A and won't match. >=20 > Rather than a special case for SQL reserved words, the ability > to quote all identifiers or quote none is generally more useful. >=20 > > -----Original Message----- > > From: Patrick Linskey (JIRA) [mailto:jira@apache.org]=20 > > Sent: Thursday, 1 March 2007 2:19 p.m. > > To: open-jpa-dev@incubator.apache.org > > Subject: [jira] Updated: (OPENJPA-84) Escape sql reserved=20 > > words in column names > >=20 > >=20 > > [=20 > > https://issues.apache.org/jira/browse/OPENJPA-84?page=3Dcom.atla > > ssian.jira.plugin.system.issuetabpanels:all-tabpanel ] > >=20 > > Patrick Linskey updated OPENJPA-84: > > ----------------------------------- > >=20 > > Fix Version/s: 1.0.0 > >=20 > > > Escape sql reserved words in column names > > > ----------------------------------------- > > > > > > Key: OPENJPA-84 > > > URL:=20 > > https://issues.apache.org/jira/browse/OPENJPA-84 > > > Project: OpenJPA > > > Issue Type: Improvement > > > Components: sql > > > Reporter: Roger Keays > > > Fix For: 1.0.0 > > > > > > > > > OpenJPA does not escape reserved words in SQL queries when=20 > > they are used as column names. To escape a reserved name you=20 > > just put it in quotes: > > > INSERT INTO FB_PRIVILEGES (comment, inheritable, level,=20 > > role, type, username, item_uuid) ... > > > on oracle, becomes > > > INSERT INTO FB_PRIVILEGES ("comment", inheritable, "level",=20 > > role, "type", username, item_uuid) ... > > > Looking at the code in DBDictionary, it appears that the=20 > > escaping is done for table and sequence names by appending a=20 > > numeral to the name. There isn't really any good reason to do=20 > > this instead of quoting the identifier. > > > table.name identifiers would have to be escaped as=20 > > "table"."name" if both table and name were reserved words. > >=20 > > -- > > This message is automatically generated by JIRA. > > - > > You can reply to this email to add a comment to the issue online. > >=20 > >=20 >=20 >=20