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:[EMAIL PROTECTED]] Sent: Thursday, October 18, 2001 2:46 PM To: [EMAIL PROTECTED] 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: [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]
