Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 44665 invoked from network); 19 Oct 2006 08:48:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Oct 2006 08:48:09 -0000 Received: (qmail 92835 invoked by uid 500); 19 Oct 2006 08:48:07 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 92813 invoked by uid 500); 19 Oct 2006 08:48:07 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 92802 invoked by uid 99); 19 Oct 2006 08:48:07 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Oct 2006 01:48:07 -0700 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,MAILTO_TO_SPAM_ADDR X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [217.146.182.53] (HELO web27903.mail.ukl.yahoo.com) (217.146.182.53) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 19 Oct 2006 01:48:05 -0700 Received: (qmail 53436 invoked by uid 60001); 19 Oct 2006 08:47:44 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=msxqk+/VbVrnfY7tRZ0p2pUzkI+mlftSt1sgmcOM/NUtT+dfkZE1LwXt82Tv9dD+QzgsyiotDr+dY7ZKkBwr6BiWQ9mE08lJAIMpHOSd9SsdKjQyw3L61+PzM5y03cmIzxi1FxsQVAjr4SXudCHIghQuFJPXJ2DhGjFZwsaqukE= ; Message-ID: <20061019084744.53434.qmail@web27903.mail.ukl.yahoo.com> Received: from [128.87.251.169] by web27903.mail.ukl.yahoo.com via HTTP; Thu, 19 Oct 2006 09:47:43 BST Date: Thu, 19 Oct 2006 09:47:43 +0100 (BST) From: Mark Cooke Subject: RE: javaName ignored? To: Apache Torque Users List In-Reply-To: <8F5843B903F59D4C8C6806BB49A3911901B7363F@dukece-mail3.dukece.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Greg, Thanks for the speedy and detailed response! I never thought about creating a view, I might try that, although others with the same problem might not have that option (assuming I can get away with it). It might be a good idea to put all the information you've just given me in the official docs - anywhere that discusses using torque with an existing database maybe. ...and maybe change the description of the javaName property to make clear that it only affects the g(s)etter names, not all the generated code. Many Thanks, Mark. --- Greg Monroe wrote: > I see that this problem occurs in the the peer > object's static column names. This is not effected > by the javaName attribute which is used in creating > the column getter/setter methods. > > The problem is that Torque currently only support > non-delimited column names. I.e., column names > that use the SQL92 (and up) identifier characters > which matches the Java identifier rules. So, > delimited column names, like "@Description" can > break the compiler rules. > > Unfortunately, I don't think there is a quick fix > for > this. The column names are used extensively in a > lot > of Templates for both Peer identifiers and as values > > for strings that identify the SQL name. If the > Column.getName() method was modified to "normalize" > the name, then the references to the actual column > name would be broken. > > Also, there may be problems with the underlying > queries being generated. Torque will not add the > delimiters to column names which could cause some > jdbc Drivers and/or DB servers to not understand > them. > E.g. The query: > > Select * from xxx where xxx.@Description = 'xxx' > > should be: > > Select * from xxx where "xxx.@Description" = 'xxx' > > to be valid SQL syntax. Torque will generate the > former. > > Maybe a quick fix is to create a view with more > standard names and use this with Torque? > > If someone has a time to burn, I guess the correct > fix would be to add a getPeerName method to the > Column model that "normalizes" the name. Then find > all the applicable entries in the templates and use > this method instead of the getName. > > I think then you might be able to use delimited > names in the XML (e.g. generate valid XML like: > > Select * from xxx where xxx."@Description" = 'xxx' > > > > -----Original Message----- > > From: Mark Cooke [mailto:markcooke666@yahoo.co.uk] > > > Sent: Wednesday, October 18, 2006 12:49 PM > > To: torque-user@db.apache.org > > Subject: javaName ignored? > > > > Hi, > > Context info: > > Existing SQL Server, with three databases/schemas, > all with > > the same structure... > > I want to use torque to generate object model > classes for > > some, but not all tables... > > ...so I start by running the jdbc task (under Ant) > against > > one of the dbs to get the schema xml, all fine > > - works as docs say it should. So then I strip > out the > > tables I don't want code generating for...then run > the "om" task. > > Problem: Since some columns have '@' at the start > of names > > (@description, for instance), so does the code > which refers > > to these columns. The docs say "javaName" > > attribute can be used to specify what the column > is called in > > java, so that's what I did - except it doesn't > make the > > blindest bit of difference. > > So, What am I doing wrong? Have I missed some > config somewhere? > > > > Thanks in Advance, > > Mark. > > > > Send instant messages to your online friends > > http://uk.messenger.yahoo.com > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > torque-user-unsubscribe@db.apache.org > > For additional commands, e-mail: > torque-user-help@db.apache.org > > > > > > Duke CE Privacy Statement > Please be advised that this e-mail and any files > transmitted with it are confidential communication > or may otherwise be privileged or confidential and > are intended solely for the individual or entity to > whom they are addressed. If you are not the > intended recipient you may not rely on the contents > of this email or any attachments, and we ask that > you please not read, copy or retransmit this > communication, but reply to the sender and destroy > the email, its contents, and all copies thereof > immediately. Any unauthorized dissemination, > distribution or copying of this communication is > strictly prohibited. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: > torque-user-help@db.apache.org > > Send instant messages to your online friends http://uk.messenger.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org