You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Shaun Campbell <Sh...@entranet.co.uk> on 2001/06/15 16:28:05 UTC

RE:Losing key field data (was Torque problem)

Eric

Thanks for that you were correct.  Unfortunately,that doesn't seem to be the
cause of my problem.  

It seems that if my column has two fields identified as the key, the second
one, if defined as an Integer, tries to create a NumberKey by getting the
value from the record as a bigDecimal, resulting in a null NumberKey object.


If the table has just one key field, which is defined as an Integer, then
the application gets the value from the database okay.    

I can't seem to find whereabouts in the code this mapping takes place.  I
don't suppose you can shed any light on this?

Thanks

Shaun

-----Original Message-----
From: Eric Dobbs [mailto:eric@dobbse.net]
Sent: 11 June 2001 23:19
To: turbine-user@jakarta.apache.org
Subject: Re: Torque problem


On Monday, June 11, 2001, at 09:46  AM, Shaun Campbell wrote:

> I don't seem to have a db.props in my conf directory, only what looks 
> like
> lots of defaults in my build directory.

Earlier in the thread you mentioned you're using the TDK.
The path Jason specified isn't in WEB-INF/conf in the TDK.

But you can find it in a couple places.  TDK uses items
from the tdk/share directory when generating the sample
application.  So you can find the master db.props file for
your database here:
tdk/share/conf/torque/templates/sql/base/<db>/db.props

And since you already have an installed application, you
will also find the operative db.props file here:
tdk/webapps/<app>/WEB-
INF/build/bin/torque/templates/sql/base/<db>/db.props

-Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Losing key field data (was Torque problem)

Posted by Eric Dobbs <er...@dobbse.net>.
On Friday, June 15, 2001, at 08:28  AM, Shaun Campbell wrote:

> It seems that if my column has two fields identified as the key, the 
> second
> one, if defined as an Integer, tries to create a NumberKey by getting 
> the
> value from the record as a bigDecimal, resulting in a null NumberKey 
> object.
>
>
> If the table has just one key field, which is defined as an Integer, 
> then
> the application gets the value from the database okay.
>
> I can't seem to find whereabouts in the code this mapping takes 
> place.  I
> don't suppose you can shed any light on this?

Shaun,
Your problem has just stepped outside of what I know about Turbine.
Specifically, I have not used multiple column primary keys, nor have
I spent any time looking at torque's java classes that drive the
generation of the code.  What I can tell you is this:

using this unix command...
find src/java/org/apache/turbine/torque -type f -exec grep -i 
primarykey {} \;

I can see that these files would be reasonable places to look:
engine/database/model/Column.java
engine/database/model/Table.java
engine/database/transform/SQLToAppData.java

I think that those classes (and others like them) are used in conjunction
with the Velocity template files in the conf/torque/templates/ directory
to construct the objects from the foo-schema.xml file.  Another good
place to look would be here:
conf/torque/templates/om/Object.vm and its neighbors.

If I am pointing you in the wrong direction, I suspect that Jason will
correct me.  8^)

-Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org