Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 32218 invoked from network); 8 Jan 2007 15:18:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jan 2007 15:18:03 -0000 Received: (qmail 8767 invoked by uid 500); 8 Jan 2007 15:18:10 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 8745 invoked by uid 500); 8 Jan 2007 15:18:10 -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 8727 invoked by uid 99); 8 Jan 2007 15:18:10 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jan 2007 07:18:10 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of Greg.Monroe@dukece.com designates 152.3.166.24 as permitted sender) Received: from [152.3.166.24] (HELO mail.dukece.com) (152.3.166.24) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jan 2007 07:18:00 -0800 Received: from dukece-mail3.dukece.com ([10.123.20.204]) by mail.dukece.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 8 Jan 2007 10:18:19 -0500 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Problems executing BasePeer.doUpdate(Criteria, Criteria, Connection) Date: Mon, 8 Jan 2007 10:17:38 -0500 Message-ID: <8F5843B903F59D4C8C6806BB49A39119022E88D1@dukece-mail3.dukece.com> In-reply-to: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problems executing BasePeer.doUpdate(Criteria, Criteria, Connection) Thread-Index: AcczBD0p5S6TcLczSPelzkYla+OfuwAMKQTQ From: "Greg Monroe" To: "Apache Torque Developers List" X-OriginalArrivalTime: 08 Jan 2007 15:18:19.0156 (UTC) FILETIME=[3A3C3D40:01C73338] X-Virus-Checked: Checked by ClamAV on apache.org A couple of extra thought about this: We probably should think about fixing this for 4.0. The=20 current correctBooleans(criteria, tablemap) is really a work around for a Village limitation. The Village free implimentation should handle booleans correctly at the=20 lowest level. As to the current implimentation, I agree that it would add a lot of overhead to check all criterii at the BasePeer level. The basic reason is that at this level, you don't=20 know what table (if any) the column is associated with like you do in the generated Peer classes. That said, you might be able to simplify your application re-write by looking at the correctBooleans(Criteria, TableMap) method in the BasePeer. Depending on how your criteria is created, you probably can modify this with some code to=20 parse out the Table name and then locate the TableMap from=20 the associated DatabaseMap. At least this would give you a single extra method to call. > -----Original Message----- > From: Thomas Fischer [mailto:fischer@seitenbau.net]=20 > Sent: Monday, January 08, 2007 4:05 AM > To: Apache Torque Developers List > Subject: Antwort: Problems executing=20 > BasePeer.doUpdate(Criteria, Criteria, Connection) >=20 > Hi Tobias, >=20 > As booleanints and booleanchars behave as ints in java but=20 > are integers and chars in the database, there needs to be a=20 > mapping somewhere in the database layer. The "high-level"=20 > methods "above" the mapping point will take booleans, the=20 > "low-level" methods "below" the mapping point will take=20 > integers and chars as arguments. Unfortunately for you, the=20 > doUpdate(Criteria, Criteria, Connection) method is below the=20 > mapping point. > Which makes a certain sense in my eyes, because you have to=20 > know the types of the columns in the table to use this method. >=20 > I know of no plans to change this behaviour. >=20 > Thomas >=20 > "Tobias Hilka" schrieb am 08.01.2007 08:54:22: >=20 > > Hi Thomas, > > > > I am sure it works with Integer values. But it would be=20 > very nice not > having > > to think about converting booleanints and booleanchars when calling=20 > > this method. If this solution is not possible, I would have=20 > to change=20 > > all occurrences of this call to use Integer values. But for=20 > > programmers just using Torque it is hard, always having to=20 > know which=20 > > mehtod can be called with which kind of Boolean/Integer value. > > > > Do you plan to change this behaviour? > > > > Best regards, > > Tobias > > > > -----Urspr=FCngliche Nachricht----- > > Von: Thomas Fischer [mailto:fischer@seitenbau.net] > > Gesendet: Freitag, 5. Januar 2007 18:26 > > An: Apache Torque Developers List > > Betreff: Antwort: Problems executing BasePeer.doUpdate(Criteria, > Criteria, > > Connection) > > > > If I remember correctly, the doUpdate(Criteria, Criteria,=20 > Connection) > method > > expects booleanints and booleancher being already converted=20 > to Integer > and > > Char. Have you tried using a new Integer(1) for true or a new > > Integer(0) for false, respectively ? > > > > Thomas > > > > "Tobias Hilka" schrieb am 05.01.2007 18:15:47: > > > > > Hello everyone, > > > > > > We are having trouble executing the doUpdate(Criteria, Criteria, > > Connection) > > > method from BasePeer. The update we want to perform is=20 > changing the=20 > > > value > > of > > > a field of type BOOLEANINT and we use a Boolean object to express=20 > > > the new state of the object in the update Criteria, we=20 > get an error=20 > > > conserning > > the > > > value we want to insert in the table. > > > > > > We tried it both, for MSSQL Server and Oracle, and each=20 > time we got=20 > > > an > > error > > > message. > > > > > > For MSSQL: > > > org.apache.torque.TorqueException: > > com.workingdogs.village.DataSetException: > > > Bad conversion: java.lang.NumberFormatException: For input string: > > "false" > > > at > > >=20 > org.apache.torque.util.BasePeer.throwTorqueException(BasePeer. > java:109) > > > at > > >=20 > org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer. > java:635) > > > at org.apache.torque.util.BasePeer.access$000(BasePeer.java:79) > > > at=20 > org.apache.torque.util.BasePeer$4.process(BasePeer.java:1220) > > > at=20 > org.apache.torque.util.BasePeer.processTables(BasePeer.java:1736) > > > at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1215) > > > > > > > > > For Oracle: > > > Don't have the exact message any more, but something=20 > like: Update to=20 > > > null not possible. > > > > > > > > > Debugging this problem I found that there is a doUpdate(Criteria, > > > Connection) method for each BasePeer. Therein the method > > > correctBooleans(criteria) is called which replaces Boolean.TRUE to > > > Integer(1) and Boolean.FALSE to Integer(0). I can not=20 > find this call=20 > > > in > > the > > > BasePeer.doUpdate(Criteria, Criteria, Connection) method. > > > > > > Could it be that this call is missing there or is there any other > > treatment > > > of this problem there? > > > > > > Thank you for your help. > > > > > > Have a nice weekend. > > > > > > Tobias > > > > > >=20 > --------------------------------------------------------------------- > > To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org > > For additional commands, e-mail: torque-dev-help@db.apache.org > > >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org > For additional commands, e-mail: torque-dev-help@db.apache.org >=20 >=20 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-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org