Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 3206 invoked from network); 11 Apr 2008 13:29:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Apr 2008 13:29:56 -0000 Received: (qmail 85415 invoked by uid 500); 11 Apr 2008 13:29:56 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 85398 invoked by uid 500); 11 Apr 2008 13:29:56 -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 85387 invoked by uid 99); 11 Apr 2008 13:29:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Apr 2008 06:29:56 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [213.23.229.179] (HELO mail.cadooz.de) (213.23.229.179) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Apr 2008 13:29:05 +0000 Received: from [127.0.0.1] (port=49133 helo=smgw) by mail.cadooz.de with esmtp (Exim 4.63) (envelope-from ) id 1JkJJm-0007dC-7i for torque-user@db.apache.org; Fri, 11 Apr 2008 15:29:26 +0200 Received: (from smtpd@127.0.0.1) by smgw (8.13.4/8.13.4) id m3BDTQE5029335 for ; Fri, 11 Apr 2008 15:29:26 +0200 Received: from unknown [127.0.0.1] by gateway id /processing/kwdd5BmB; Fri Apr 11 15:29:25 2008 Received: from MailerDaemon by mail.cadooz.de with local-bsmtp (Exim 4.63) (envelope-from ) id 1JkJJl-0007d3-Hx for torque-user@db.apache.org; Fri, 11 Apr 2008 15:29:25 +0200 Received: from [192.168.107.5] (port=54854 helo=securemail.cadooz-ag.intern) by mail.cadooz.de with esmtp (Exim 4.63) (envelope-from ) id 1JkJJj-0007cu-Vi for torque-user@db.apache.org; Fri, 11 Apr 2008 15:29:24 +0200 Received: from securemail (localhost [127.0.0.1]) by securemail.cadooz-ag.intern (Postfix) with ESMTP id F0BDC6BC05A for ; Fri, 11 Apr 2008 15:29:23 +0200 (CEST) Received: from srv-master.cadooz-ag.intern (srv-master.cadooz-ag.intern [192.168.107.3]) by securemail.cadooz-ag.intern (Postfix) with ESMTP id E16016BC059 for ; Fri, 11 Apr 2008 15:29:23 +0200 (CEST) Received: from intranet.cadooz.de ([192.168.107.7]) by srv-master.cadooz-ag.intern with Microsoft SMTPSVC(6.0.3790.3959); Fri, 11 Apr 2008 15:29:23 +0200 Received: from srv-exchange.cadooz-ag.intern (srv-exchange.cadooz-ag.intern [192.168.107.12]) by intranet.cadooz.de (Postfix) with ESMTP id B6071A98014 for ; Fri, 11 Apr 2008 15:29:23 +0200 (CEST) Received: from srv-exchange.cadooz-ag.intern ([192.168.107.12]) by srv-exchange.cadooz-ag.intern ([192.168.107.12]) with mapi; Fri, 11 Apr 2008 15:29:23 +0200 From: Thoralf Rickert To: "'Apache Torque Users List'" Date: Fri, 11 Apr 2008 15:29:23 +0200 Thread-Topic: RE: Column names with spaces Thread-Index: AcibKLoJRFjASgSSTiWU6wwzhna/BgAAovQQACjqhpAAAQVl4AABIj9A Message-ID: References: <8F5843B903F59D4C8C6806BB49A3911906238570@dukece-mail3.dukece.com> <8F5843B903F59D4C8C6806BB49A3911906238B63@dukece-mail3.dukece.com> In-Reply-To: <8F5843B903F59D4C8C6806BB49A3911906238B63@dukece-mail3.dukece.com> Accept-Language: de-DE acceptlanguage: de-DE MIME-Version: 1.0 X-OriginalArrivalTime: 11 Apr 2008 13:29:23.0806 (UTC) FILETIME=[0E7837E0:01C89BD8] X-TBoneOriginalFrom: Thoralf Rickert X-TBoneOriginalTo: 'Apache Torque Users List' X-TBoneDomainSigned: false X-SecurE-Mail-Gateway: Version: 5.00.3.3_ASTARO (smtpd: 6.53.9.0) Date: 20080411132925Z Subject: AW: RE: Column names with spaces MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="----534746975D16AFA3FFE9965B991747E1" X-Virus-Checked: Checked by ClamAV on apache.org ------534746975D16AFA3FFE9965B991747E1 Content-Language: de-DE Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Thanks for the answers. I think the View is the best solution for now. The changes to all the Base* classes and Base*Peers is not a problem, but t= he criteria and the generated sql commands don't like the spaces if it isn'= t escaped. bye Thoralf > -----Urspr=FCngliche Nachricht----- > Von: Greg Monroe [mailto:Greg.Monroe@DukeCE.com] > Gesendet: Freitag, 11. April 2008 15:16 > An: Apache Torque Users List > Betreff: RE: Column names with spaces > > OK, short version: If you can't change the existing schema, > use a view to get valid names. > > Longer version: > > Actually, the "[" syntax is not the only one that can be used > with MS SQL. It also supports the SQL Standard defined > delimited identifiers. In the standard, normal identifiers > (e.g. column/table names) have the same rules as Java/C > variables. (with the exception that they are case insensitive...) > > If you want/need to use characters outside of this set, you > need to use delimited identifiers. These have the Standard > defined syntax of "My Table!" (double quote's included). > Delimited identifiers ARE case sensitive. > So, the standards version id of a column in your table would > be written like: "Time after".time_col > > AFAIK, this syntax is pretty widely supported by the major DB players. > > As Thomas F said, getting Torque to recognize and map the > Java names to the real names is going to be a hard thing. > > One thing that *might* work out of the box is the various ant > tasks. If you define your names in the XML to include the > double quotes, the SQL generated by these should work. > > To be complete, I guess you could also try to generate the > code with the delimited cases and then "fix up" the classes > that don't compile. You'd also have to make sure the Map > classes used the correct strings as well. Not very > maintainable but... > > > > -----Original Message----- > > From: Thoralf Rickert [mailto:thoralf.rickert@cadooz.de] > > Sent: Friday, April 11, 2008 8:39 AM > > To: 'Apache Torque Users List' > > Subject: Column names with spaces > > > > Hi, > > > > Of course the list of problems with mssql doesn't stop... > > > > I've got now a xml schema from the existing database. Some "lovely > boy" > > decided years ago that it would be nice to use spaces inside the > column > > names of the database scheme. For example: "Time after". > This is not a > > problem if you use the special syntax "[Time after]" in a > select. But > I > > don't have this kind of access with Torque (prove me wrong, if not). > If > > I try to make a Criteria, Torque quits this selection with > > > > Malformed column name in Criteria getTableName: 'T_Stammdaten.Time > > after' is not of the form 'table.column' > > > > Okay, actually this is an error that doesn't have something > to do with > > the real problem. Is there a way to setup a database > specific syntax > > for column names. So in MySQL it would be "`" or in MSSQL/Sybase it > > would be "[" and "]". > > > > Additionally - I think the "torque" task that generates the classes > > should escape the spaces if it uses the database column names to > > generate column constants (currently it produces > > > > public static String TIME AFTER =3D "...". > > > > Has somebody an idea, how to get around this problem? > > > > > > Bye > > Thoralf > DukeCE 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 > > ------534746975D16AFA3FFE9965B991747E1 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" MIIHqAYJKoZIhvcNAQcCoIIHmTCCB5UCAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3 DQEHAaCCBQUwggUBMIIEaqADAgECAg5usgABAAIwWJT7ToAkejANBgkqhkiG9w0B AQUFADB9MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i SDElMCMGA1UECxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBMMSBDQTEpMCcGA1UE AxMgVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBMMSBDQSBJSUkwHhc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