Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 23003 invoked from network); 30 Oct 2006 03:27:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2006 03:27:28 -0000 Received: (qmail 5183 invoked by uid 500); 30 Oct 2006 03:27:39 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 5165 invoked by uid 500); 30 Oct 2006 03:27:39 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 5154 invoked by uid 99); 30 Oct 2006 03:27:38 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Oct 2006 19:27:38 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Oct 2006 19:27:24 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B152B7142E7 for ; Sun, 29 Oct 2006 19:26:17 -0800 (PST) Message-ID: <13719933.1162178777723.JavaMail.root@brutus> Date: Sun, 29 Oct 2006 19:26:17 -0800 (PST) From: "CG Monroe (JIRA)" To: torque-dev@db.apache.org Subject: [jira] Updated: (TORQUE-44) Column names in generated classes are uppercase In-Reply-To: <14344174.1153128073929.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/TORQUE-44?page=all ] CG Monroe updated TORQUE-44: ---------------------------- Attachment: Torque-44.zip Change Log for "New and Improved" Torque-44 patch. Overview This patch will make Torque OM Peer class column constant use values with the exact same case as the XML name= attribute. However, the original upper case column name constants can be produced by adding the following build property to your generator property settings: torque.deprecated.uppercasePeer = true In addition, all references in the templates to Peer column constants have been converted to use a new getPeerJavaName method in the Column generator object. This was done for several reasons: To allow columns to be named TABLE_NAME or DATABASE_NAME (Column constant names for these are modified to _TABLE_NAME and _DATABASE_NAME) To lay some ground work for future support of delimited columns To centralize the naming convention into an easily overridable class rather than spread over several different templates. Also, the templates use the existing getFullyQualifiedName method to set the Column constant values. (So it can be overridden by in the class if desired). Finally, the properties reference and Database Layout How To have been updated. File mods: Column.java Added getPeerJavaName() method with handling for renaming TABLE_NAME and COLUMN_NAME columns. properties-reference.xml Added torque.deprecated.uppercasePeer property at the bottom of the Template variables section database-layout-howto.xml Added some info about problems using delimited column names and the special handling of TABLE_NAME and DATABASE_NAME columns. MapBuilder.vm, Object.vm, ObjectWithManager.vm, Peer.vm Peer name references updated. Some unused SET statements removed. Support for new and old methods in generation > Column names in generated classes are uppercase > ----------------------------------------------- > > Key: TORQUE-44 > URL: http://issues.apache.org/jira/browse/TORQUE-44 > Project: Torque > Issue Type: Bug > Components: Generator > Affects Versions: 3.2, 3.1.1, 3.1 > Reporter: Thoralf Rickert > Assigned To: Thomas Fischer > Fix For: 3.2.1 > > Attachments: patch.txt, Torque-44.zip > > > The generator creates constants for the column names in tables. The content of this constants uses upper cases. > For example if you have a table like: > > > > > > > > > > > > > > > > >
> The generator creates in the corresponding BaseAddressPeer the following constants. > ... > static > { > CLASS = "address.CLASS"; > ID = "address.ID"; > POSITION = "address.POSITION"; > NAME1 = "address.NAME1"; > NAME2 = "address.NAME2"; > NAME3 = "address.NAME3"; > STREET = "address.STREET"; > ZIPCODE = "address.ZIPCODE"; > CITY = "address.CITY"; > PHONE = "address.PHONE"; > PHONE2 = "address.PHONE2"; > COUNTRY = "address.COUNTRY"; > STATE = "address.STATE"; > FAX = "address.FAX"; > EMAIL = "address.EMAIL"; > .... > but this variables should be for example "address.email". > The AddressMapBuilder.doBuild() method creates the same uppercase mapping: > public void doBuild() throws TorqueException { > ... > dbMap.addTable("address"); > TableMap tMap = dbMap.getTable("address"); > tMap.setPrimaryKeyMethod("none"); > tMap.addPrimaryKey("address.CLASS", "" ); > tMap.addPrimaryKey("address.ID", "" ); > tMap.addPrimaryKey("address.POSITION", new Integer(0) ); > tMap.addColumn("address.NAME1", "", 50 ); > tMap.addColumn("address.NAME2", "", 50 ); > tMap.addColumn("address.NAME3", "", 50 ); > tMap.addColumn("address.STREET", "", 50 ); > tMap.addColumn("address.ZIPCODE", "", 25 ); > tMap.addColumn("address.CITY", "", 60 ); > tMap.addColumn("address.PHONE", "", 40 ); > tMap.addColumn("address.PHONE2", "", 40 ); > tMap.addColumn("address.COUNTRY", "", 200 ); > tMap.addColumn("address.STATE", "", 200 ); > tMap.addColumn("address.FAX", "", 40 ); > tMap.addColumn("address.EMAIL", "", 150 ); > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org