turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Campbell" <campb...@kontiki.com>
Subject RE: torque primary key INTEGER
Date Thu, 18 Oct 2001 23:03:14 GMT
just my $0.02,

The point is that you have to deal with one underlying datatype in two
different ways. If you want to put a primary key in another table in
which it is not a primary key, the ObjectKey stuff is cumbersome. It has
also caused me some grief because an int primary key gets populated with
float when I use certain oracle drivers, and int when I use others.  

Chris

-----Original Message-----
From: John McNally [mailto:jmcnally@collab.net]
Sent: Thursday, October 18, 2001 2:46 PM
To: turbine-user@jakarta.apache.org
Subject: Re: torque primary key INTEGER


What is your reason for needing the primary key as an int?  Are you
doing mathematical operations on it?  The unique identifiers for the
objects are based on the primary keys.  And they are all of type
ObjectKey.  This allows torque to treat String, integer and date columns
generically when used as a primary key.  It is a good practice not to
use primary keys with business meaning.

john mcnally

Geoff Fortytwo wrote:
> 
> When I mark a field as type="INTEGER" and then mark it as a primary
key
> using primaryKey="true" then the java data type that's used is
NumberKey.
> If I don't mark it as a primary key then the java data type is int.
Why is
> that? It just causes me more hassle because to get the value I have to
do:
>    blah.getId().getBigDecimal().intValue()
> instead of just doing
>    blah.getId()
> 
> ---------------------------------------------------------------------
> 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


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


Mime
View raw message