Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 73E1C1088F for ; Mon, 10 Feb 2014 22:54:26 +0000 (UTC) Received: (qmail 6770 invoked by uid 500); 10 Feb 2014 22:54:09 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 6701 invoked by uid 500); 10 Feb 2014 22:54:03 -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 6526 invoked by uid 99); 10 Feb 2014 22:53:52 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Feb 2014 22:53:52 +0000 Date: Mon, 10 Feb 2014 22:53:52 +0000 (UTC) From: "Aron Lurie (JIRA)" To: dev@openjpa.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (OPENJPA-1540) XMLSchemaSerializer outputs funny values for column name attributes (regression from 1.2.2) 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-1540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13897163#comment-13897163 ] Aron Lurie commented on OPENJPA-1540: ------------------------------------- I need to revive this ticket. Running into this issue with an Oracle database. Whenever a column name contains lowercase characters, the generated annotation has incorrect delimiters as described by original reporter. EXAMPLE GENERATED CODE import javax.persistence.*; /** * Auto-generated by: * org.apache.openjpa.jdbc.meta.ReverseMappingTool$AnnotatedCodeGenerator */ @Entity @Table(schema="MYUSER", name="T_CONSTRAINT") public class TConstraint { private String constraint; private String description; public TConstraint () { } public TConstraint (String constraint) { this.constraint = constraint; } @Id @Column(name=""Constraint"", length=16) public String getConstraint() { return constraint; } public void setConstraint(String constraint) { this.constraint = constraint; } @Basic @Column(length=50) public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } } OPENJPA REVISION INFO revision.number=422266:1491915 openjpa.version=2.3.0-SNAPSHOT openjpa.enhancer.revision=1461751 > XMLSchemaSerializer outputs funny values for column name attributes (regression from 1.2.2) > ------------------------------------------------------------------------------------------- > > Key: OPENJPA-1540 > URL: https://issues.apache.org/jira/browse/OPENJPA-1540 > Project: OpenJPA > Issue Type: Bug > Components: jdbc > Affects Versions: 2.0.0-beta > Reporter: Laird Nelson > Assignee: Jeremy Bauer > > During a reverse mapping run, it's often common to take the output of a SchemaGenerator and feed it to an XMLSchemaSerializer via its addAll() method. > When the DBDictionary that was in effect at schema generation time is one that supports delimiters (see InformixDictionary), then the identifiers on all the artifacts in the SchemaGroup housed by the SchemaGenerator have quotes in them. > Consequently, when the XMLSchemaSerializer writes its schemas to disk, you can get strange results. Here's an example fragment: > > Technically I suppose this may not be a bug in XMLSchemaSerializer, since it is simply serializing what it is handed. But given that other tools consume its XML schema files, and given that the value of name attribute will be read in as a String, and given that usually what happens is that a String is turned into a DBIdentifier and delimited/quoted as necessary, I am not sure that delimiters should be stored by the XMLSchemaSerializer. > A downstream effect of this bug is that any reverse mapping that takes place from here involving annotations will not compile. That is, if you ask the ReverseMappingTool for example to produce annotated Java objects, the annotations will look like this: > @Column(name=""foobar"") > ...which will not compile. -- This message was sent by Atlassian JIRA (v6.1.5#6160)