Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 53136 invoked from network); 14 Dec 2006 14:19:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Dec 2006 14:19:20 -0000 Received: (qmail 41503 invoked by uid 500); 14 Dec 2006 14:19:28 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 41216 invoked by uid 500); 14 Dec 2006 14:19:27 -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 41205 invoked by uid 99); 14 Dec 2006 14:19:27 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Dec 2006 06:19:27 -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 65.112.55.73 as permitted sender) Received: from [65.112.55.73] (HELO mail.dukece.com) (65.112.55.73) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Dec 2006 06:19:17 -0800 Received: from dukece-mail3.dukece.com ([192.168.1.222]) by mail.dukece.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 14 Dec 2006 09:19:30 -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: AW: BigDecimal and MySQL decimal Date: Thu, 14 Dec 2006 09:18:55 -0500 Message-ID: <8F5843B903F59D4C8C6806BB49A391190215FC81@dukece-mail3.dukece.com> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: AW: BigDecimal and MySQL decimal Thread-Index: Accfh7aRttfhXHovS4CQ4HE1ETu9ugAAbF1A From: "Greg Monroe" To: "Apache Torque Users List" X-OriginalArrivalTime: 14 Dec 2006 14:19:30.0640 (UTC) FILETIME=[DEBFAD00:01C71F8A] X-Virus-Checked: Checked by ClamAV on apache.org For the record, the "proper" way to do this since Torque 3.2 is to use the size and scale attributes. (Though the older size=3D(size,scale) is still supported). One thing that can cause the SAX parsing exception is if=20 the DTD specified in the DOCTYPE of your schema isn't set to=20 use the same DTD as the version you're generating with. E.g.: This will let you use any new XML attributes. > -----Original Message----- > From: Jon August [mailto:jon@internection.com]=20 > Sent: Thursday, December 14, 2006 8:55 AM > To: Apache Torque Users List > Cc: Thoralf Rickert > Subject: Re: AW: BigDecimal and MySQL decimal >=20 >=20 > The suggestions by Thoralf and Alvaro fixed the problem. My=20 > issue with the NullPointerException was unrelated. >=20 > Thanks for the help. >=20 > -Jon >=20 >=20 >=20 > On Dec 14, 2006, at 8:35 AM, Jon August wrote: >=20 > > Thanks - that fixed the "maven torque"... > > > > Now when I do the save from my object, I get an error that I wasn't=20 > > getting when the scale wasn't set: > > > > java.lang.NullPointerException > > java.math.BigDecimal.(BigDecimal.java:181) > > > > > > > > > > > > > > > > On Dec 14, 2006, at 7:55 AM, Thoralf Rickert wrote: > > > >> Try size=3D"7,2" instead of size=3D".." scale=3D".." > >> > >> > >> > >>> -----Urspr=FCngliche Nachricht----- > >>> Von: Jon August [mailto:jon@internection.com] > >>> Gesendet: Donnerstag, 14. Dezember 2006 13:52 > >>> An: Apache Torque Users List > >>> Betreff: Re: BigDecimal and MySQL decimal > >>> > >>> > >>> Hey Alvaro, > >>> > >>> Thanks for the suggestion. I tried this: > >>> > >>> >>> type=3D"DECIMAL" /> > >>> > >>> but I get this error when I run "maven torque": > >>> > >>> org.apache.torque.engine.EngineException:=20 > org.xml.sax.SAXException: > >>> Error while parsing wp-schema.xml at line 13 column 77 :=20 > Attribute=20 > >>> "scale" must be declared for element type "column". > >>> > >>> > >>> Is my syntax incorrect? > >>> > >>> -Jon > >>> > >>> > >>> > >>> > >>> > >>> On Dec 14, 2006, at 7:24 AM, Alvaro Coronel wrote: > >>> > >>>> I have had no trouble using it just as you do. Maybe you haven't=20 > >>>> set the scale yet. > >>>> > >>>> This is an excerpt of my schema.xml file: > >>>> > >>>> >>>> required=3D"true" > >>>> scale=3D"2" > >>>> size=3D"7" > >>>> type=3D"DECIMAL" /> > >>>> > >>>> What I usually do is to define the schema.xml file and from it=20 > >>>> obtain the .sql file via ant to create the database. > >>>> > >>>> Good luck, > >>>> =C1lvaro. > >>>> > >>>> Jon August wrote: Hey, > >>>> > >>>> I'm using decimal (in the schema) to store a dollar amount > >>> in my MySQL > >>>> database. I get the value from a web page and convert it to a=20 > >>>> BigDecimal before storing it. For some reason, the=20 > decimal portion=20 > >>>> gets truncated and $10.32 gets stored as 10. Should I be using=20 > >>>> something other than BigDecimal or is there something else wrong? > >>>> > >>>> Sorry if this is not a torque question. > >>>> > >>>> -Jon > >>>> > >>>> > >>>=20 > -------------------------------------------------------------------- > >>> - > >>>> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > >>>> For additional commands, e-mail: torque-user-help@db.apache.org > >>>> > >>>> > >>>> > >>>> > >>>> --------------------------------- > >>>> Want to start your own business? Learn how on Yahoo! Small=20 > >>>> Business. > >>> > >>> > >>>=20 > -------------------------------------------------------------------- > >>> - > >>> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > >>> For additional commands, e-mail: torque-user-help@db.apache.org > >>> > >>> > >> > >> > >> > >>=20 > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > >> For additional commands, e-mail: torque-user-help@db.apache.org > >> > > >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-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-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org