On 6/11/01 10:58 AM, "Shaun Campbell" <[EMAIL PROTECTED]> wrote:
> OK I've got it. Somehow Torque is interpreting my column, defined as an
> INTEGER in the project xml file, as a bigDecimal. Changing the generated
> code to use asInt instead of asBigDecimal fixes the problem.
>
> Can someone tell me where the database definitions are held, or where the
> change above is defined?
>
> Thanks
>
> Shaun
>
> -----Original Message-----
> From: Shaun Campbell [mailto:[EMAIL PROTECTED]]
> Sent: 08 June 2001 21:51
> To: [EMAIL PROTECTED]
> Subject: Torque problem
>
>
> I have an existing app that I am trying to update from tdk1a13 to tdk2.1b4.
> The app used to work using tdk1a13, but under tdk2.1b4 I don't seem to be
> getting a value from one column on a particular table.
>
> I have followed the code through until I come to a populateObject method in
> my BaseGencalitemPeer.java class.
>
> The following 3 lines of debug
>
> System.out.println("row value is " +
> row.getValue(offset+1));
> NumberKey nk = new
> NumberKey(row.getValue(offset+1).asBigDecimal());
> System.out.println("numberKey is " + nk.getValue());
>
> generate the following output:
>
> row value is 7
> numberKey is null
>
> So I am retrieving the value from the database but a number key is not
> generated properly.
>
> My schema for this table is:
>
> <table name="genCalItem">
> <column name="calname" primaryKey="true" required="true"
> type="VARCHAR"></column>
> <column name="day" primaryKey="true" required="true"
> type="INTEGER"></column>
> <column name="starthour" required="true" type="INTEGER"
> default="0"></column>
> <column name="startminute" required="true" type="INTEGER"
> default="0"></column>
> <column name="endhour" required="true" type="INTEGER"
> default="0"></column>
> <column name="endminute" required="true" type="INTEGER"
> default="0"></column>
> </table>
>
> As far as I can see the column is defined as an Integer but the NumberKey
> treats it as a bigDecimal. Apart from that the only thing that I can see is
> that there are two primary key fields defined on the first and second
> columns (a composite key).
>
> Can anyone suggest why the NumberKey is getting set to null and hence is
> losing me my values in this field?
The properties for a database that Torque uses are stored in
conf/torque/templates/sql/base/<db>/db.props.
> Regards
>
> Shaun Campbell
>
> ---------------------------------------------------------------------
> 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]
--
jvz.
http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]