From torque-user-return-7338-apmail-db-torque-user-archive=db.apache.org@db.apache.org Thu Dec 14 14:43:54 2006 Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 72918 invoked from network); 14 Dec 2006 14:43:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Dec 2006 14:43:54 -0000 Received: (qmail 95835 invoked by uid 500); 14 Dec 2006 14:44:01 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 95816 invoked by uid 500); 14 Dec 2006 14:44:01 -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 95805 invoked by uid 99); 14 Dec 2006 14:44:01 -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:44:01 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [66.174.85.156] (HELO txslsmtp2.vzwmail.net) (66.174.85.156) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Dec 2006 06:43:49 -0800 Received: from [10.0.1.6] (smtp.vzwmail.net [66.174.85.25]) (authenticated bits=0) by txslsmtp2.vzwmail.net (8.12.9/8.12.9) with ESMTP id kBEEhR0b027613 for ; Thu, 14 Dec 2006 14:43:28 GMT Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <8F5843B903F59D4C8C6806BB49A391190215FC81@dukece-mail3.dukece.com> References: <8F5843B903F59D4C8C6806BB49A391190215FC81@dukece-mail3.dukece.com> Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <9C3C74AE-EFE6-47B5-A454-C489975F13B4@internection.com> Content-Transfer-Encoding: quoted-printable From: Jon August Subject: Re: AW: BigDecimal and MySQL decimal Date: Thu, 14 Dec 2006 09:43:28 -0500 To: "Apache Torque Users List" X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org You're right. I had 3.1 in the DOCTYPE. The separate attribute =20 method is working for me. On Dec 14, 2006, at 9:18 AM, Greg Monroe wrote: > 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 > the DTD specified in the DOCTYPE of your schema isn't set to > use the same DTD as the version you're generating with. E.g.: > > "http://db.apache.org/torque/dtd/database_3_2.dtd"> > > This will let you use any new XML attributes. > >> -----Original Message----- >> From: Jon August [mailto:jon@internection.com] >> Sent: Thursday, December 14, 2006 8:55 AM >> To: Apache Torque Users List >> Cc: Thoralf Rickert >> Subject: Re: AW: BigDecimal and MySQL decimal >> >> >> The suggestions by Thoralf and Alvaro fixed the problem. My >> issue with the NullPointerException was unrelated. >> >> Thanks for the help. >> >> -Jon >> >> >> >> On Dec 14, 2006, at 8:35 AM, Jon August wrote: >> >>> Thanks - that fixed the "maven torque"... >>> >>> Now when I do the save from my object, I get an error that I wasn't >>> 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: >> org.xml.sax.SAXException: >>>>> Error while parsing wp-schema.xml at line 13 column 77 : >> Attribute >>>>> "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 >>>>>> 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 >>>>>> 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 >>>>>> BigDecimal before storing it. For some reason, the >> decimal portion >>>>>> gets truncated and $10.32 gets stored as 10. Should I be using >>>>>> something other than BigDecimal or is there something else wrong? >>>>>> >>>>>> Sorry if this is not a torque question. >>>>>> >>>>>> -Jon >>>>>> >>>>>> >>>>> >> -------------------------------------------------------------------- >>>>> - >>>>>> 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 >>>>>> Business. >>>>> >>>>> >>>>> >> -------------------------------------------------------------------- >>>>> - >>>>> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org >>>>> For additional commands, e-mail: torque-user-help@db.apache.org >>>>> >>>>> >>>> >>>> >>>> >>>> >> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org >>>> For additional commands, e-mail: torque-user-help@db.apache.org >>>> >>> >> >> >> --------------------------------------------------------------------- >> 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 =20 > it are confidential communication or may otherwise be privileged or =20= > confidential and are intended solely for the individual or entity =20 > to whom they are addressed. If you are not the intended recipient =20 > you may not rely on the contents of this email or any attachments, =20 > and we ask that you please not read, copy or retransmit this =20 > communication, but reply to the sender and destroy the email, its =20 > contents, and all copies thereof immediately. Any unauthorized =20 > dissemination, distribution or copying of this communication is =20 > strictly prohibited. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org