Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 18547 invoked from network); 23 Aug 2004 02:12:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 23 Aug 2004 02:12:13 -0000 Received: (qmail 15478 invoked by uid 500); 23 Aug 2004 02:12:12 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 15422 invoked by uid 500); 23 Aug 2004 02:12:11 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: 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 15402 invoked by uid 99); 23 Aug 2004 02:12:11 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [203.202.1.123] (HELO barge.anchor.net.au) (203.202.1.123) by apache.org (qpsmtpd/0.27.1) with ESMTP; Sun, 22 Aug 2004 19:12:08 -0700 Received: from [192.168.0.2] (CPE-61-9-201-26.nsw.bigpond.net.au [61.9.201.26]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by barge.anchor.net.au (Postfix) with ESMTP id 5A3BB10056 for ; Mon, 23 Aug 2004 12:12:06 +1000 (EST) Message-ID: <41295272.1070105@backstagetech.com.au> Date: Mon, 23 Aug 2004 12:12:02 +1000 From: Scott Eade User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Apache Torque Developers List Subject: Re: [PATCH TORQUE-3.1.1] Name Boolean/boolan getters correctly for generated objects References: <1093045984.12360.7.camel@localhost> In-Reply-To: <1093045984.12360.7.camel@localhost> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Henning, I like what this patch does, but I have a couple of concerns. Firstly I think the fact that this would result in Torque 3.1.1 generating different method names to Torque 3.1 (at least for boolean columns) is not something users would be expecting. Secondly, from the perspective of a Turbine user, have/will the mapper methods in ParameterParser, et al, been/be updated? I know that my Turbine applications would fail if this patch is applied and I regenerate my om. IMHO it would be more appropriate to introduce such a change in Torque 3.2. A more acceptable alternative would be if the generated code provides both the current "get" methods (perhaps marking them as deprecated) and the new "is methods. It would be nice to know that the Turbine ParameterParser was going to sync up with this change in some future release. A few additional minor points: 1. I have highlighted a change below that I think you may like to reverse (an erroneous replace I think). 2. I have also highlighted an instance where you introduce an space character after method names in the generated code (I only highlighted one of these but there are more). While the generated code is not all that attractive there is no reason to make it worse. This was highlighted to me by comparing changes to the generated code after applying your patch - it results in a whole bunch of changes that are just the introduction of a space. 3. The Object.vm changes need to be replicated for ObjectWithManager.vm Scott -- Scott Eade Backstage Technologies Pty. Ltd. http://www.backstagetech.com.au Henning Schmiedehausen wrote: >Hi Scott, > >I know that you are close to the 3.1.1 release of Torque but I would >really want you to consider the attached patch. It changes the >generation of the Getter and Setter methods in the Object.vm and Peer.vm >to ask the Column. The column object gets two additional getters, called >getGetterName() and getSetterName(). The getSetterName() just returns >"set$Property", but the getGetterName() returns "is$property" if the >property value is either boolean or a java.lang.Boolean. > >This is in accordance to the Sun Java Beans rules and I would really >like to see this patch in the 3.1.1 release. > > Regards > Henning > > > >Index: src/templates/om/Object.vm >=================================================================== >RCS file: /home/cvs/db-torque/src/generator/src/templates/om/Object.vm,v >retrieving revision 1.7.2.3 >diff -u -r1.7.2.3 Object.vm >--- src/templates/om/Object.vm 14 Aug 2004 12:02:33 -0000 1.7.2.3 >+++ src/templates/om/Object.vm 20 Aug 2004 23:45:29 -0000 >@@ -121,7 +121,7 @@ > * > * @return $cjtype > */ >- public $cjtype get${cfc}() >+ public $cjtype ${col.GetterName} () > > ---------------------------------------^ Why the space here? > { > return $clo; > } >@@ -143,7 +143,7 @@ > * > * @param v new value > */ >- public void set${cfc}($cjtype v) $throwsClause >+ public void $col.SetterName ($cjtype v) $throwsClause > { > #if (($cjtype == "NumberKey") || ($cjtype == "StringKey") || ($cjtype == "DateKey")) > if (v != null && v.getValue() == null) > > >@@ -501,7 +501,7 @@ > public void add${relColMs}($className l) throws TorqueException > { > get${relCol}().add(l); >- l.set${table.JavaName}${suffix}(($table.JavaName) this); >+ l.${table.SetterName}${suffix}(($table.JavaName) this); > > -------------^^^^^^^^^^^^^^^^^^ You most likely don't want this change. > } > > /** > > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org