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.<init>(BigDecimal.java:181)
On Dec 14, 2006, at 7:55 AM, Thoralf Rickert wrote:
Try size="7,2" instead of size=".." scale=".."
-----Ursprüngliche Nachricht-----
Von: Jon August [mailto:[EMAIL PROTECTED]
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:
<column name="price" scale="2" size="7"
type="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:
<column name="moncotiza"
required="true"
scale="2"
size="7"
type="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,
Álvaro.
Jon August <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------
Want to start your own business? Learn how on Yahoo! Small
Business.
--------------------------------------------------------------------
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]