Randahl,

We use the primitive long for all of our primary keys for a couple of
reasons:
* primary keys can't be null so there isn't a need for Long (or Integer)
* long's are always 4 bytes no matter what the CPU (32bit vs 64bit), which
is currently not a problem but could be when Itanium platforms come out.
int's depend on the CPU's native integer type which happens to be 32bits on
ix86 architectures.

Michael Third
Chief Software Architect
parts.com


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Randahl Fink
Isaksen
Sent: Wednesday, February 28, 2001 10:02 AM
To: Orion-Interest
Subject: Database schema type mappings


If you look at the database schema in
"orion/config/database-schemas/hypersonic.xml" it looks as if it is mapping
between the primitive java type "int" and the corresponding database type
"int":
<type-mapping type="int" name="int" />.

In my EJBs my primary keys and other attributes are of type Integer. Since
there is no mapping for class Integer one could think that Integers would be
mapped to VARBINARY. Luckily my integers are mapped to the database type
"int", but this makes me ask two questions:

1. Why is Integers automatically converted to int by Orion - and is this a
standard EJB convention?
2. Would it be legal to have a primary key of the primitive type "int"
instead of Integer?


Yours

Randahl


Reply via email to