Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 71935 invoked from network); 6 Oct 2005 05:50:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Oct 2005 05:50:59 -0000 Received: (qmail 44369 invoked by uid 500); 6 Oct 2005 05:50:59 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 44131 invoked by uid 500); 6 Oct 2005 05:50:58 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 44120 invoked by uid 99); 6 Oct 2005 05:50:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2005 22:50:58 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [207.172.4.61] (HELO smtp01.mrf.mail.rcn.net) (207.172.4.61) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2005 22:51:01 -0700 Received: from 205-178-43-150.s404.tnt1.sfrn.ca.dialup.rcn.com (HELO Nipper.rcn.com) ([205.178.43.150]) by smtp01.mrf.mail.rcn.net with ESMTP; 06 Oct 2005 01:50:33 -0400 X-IronPort-AV: i="3.97,180,1125892800"; d="scan'208"; a="93631052:sNHT2399290490" Message-Id: <6.2.3.4.2.20051005221321.0381fd68@pop.rcn.com> X-Mailer: QUALCOMM Windows Eudora Version 6.2.3.4 Date: Wed, 05 Oct 2005 22:50:28 -0700 To: "Derby Development" From: Jeffrey Lichtman Subject: Re: [PATCH]Derby-582 Dynamic parameter should be allowed to be the operand of unary operator "-". In-Reply-To: References: <4343DEC0.5070805@debrunners.com> <4343FA11.90406@debrunners.com> <4343FDFF.4090007@debrunners.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N >SQLToJavaValueNode.getJSQLType after checking isParameterNode does >ParameterNode casting so it can get to getJSQLType method. But since >UnaryOperatorNode is not of the type ParameterNode, the casting >fails, as expected. I can remove the casting but that would mean to >implement getJSQLType method in ValueNode as well. But does this >method make a sense for ValueNode? If we do decide to add this >method, UnaryOperatorNode will simply call the same method on it's operand. I'll try to help. The bindParameters() method in MethodCallNode gets the signature of the method call from the parameters to the method. This signature is in the form of an array of JSQLTypes. A JSQLType is a sort of universal type descriptor that can describe any of three different catagories: a SQL type (like VARCHAR), a Java primitive type (like byte) or a Java class (like java.lang.String). It was introduced by the synchronization/replication team for some reason I don't clearly remember - it had something to do with the need to log and replicate method invocations on any of the three categories. Originally a method signature was represented as an array of Java types. Although any value node can have a JSQLType associated with it, it looks to me like no attempt is made to maintain this association for most types of ValueNodes. ParameterNodes do maintain the association - this is one of the special things done by setDescriptor() in ParameterNode. I believe this was done for the sake of synchronization/replication. We could push this up into ValueNode, but the idea makes me nervous - I don't want the entire ValueNode hierarchy to know about JSQLTypes, which are special-purpose types that most of the nodes shouldn't have to deal with. Remember the mail I sent earlier on the question of making UnaryOperatorNode extend ParameterNode? I suggested that, rather than do this, we introduce a method called getsTypeFromContext() to determine whether the type information should be pushed down from the node above. If we used this method for this one purpose, and continued to use isParameterNode() to determine whether the node is a parameter, we wouldn't run into the problem you're encountering here. - Jeff Lichtman swazoo@rcn.com Check out Swazoo Koolak's Web Jukebox at http://swazoo.com/