I am struggling with something, and hoping that someone
might have an update. According to the EJB spec:
a) Primary keys can only be valueyptes. This precludes
using "int" as a primary key type.
b) For CMP, primary keys must have a default constructor.
This precludes using "java.lang.Integer" as a primary key
type.
c) Primary Key wrapper classes for single field primary
keys are deprecated in EJB 1.1. This precludes using a
class FooPK as a primary key type.
Thus, according to the EJB specification, there is no way
to have a number as a primary key type.
Clearly this is not acceptable. I would recommend the
following changes to the spec:
a) Allow primary key types to be either a valuetype _or_ a
Java primitive.
b) Special case all subclasses of java.lang.Number to be
allowed as primary key types.
I think both rules should be added. The first rule is more
useful, IMO, since "int" is a Java way to indicate a
non-null Integer, which corresponds nicely to a well formed
primary key (which also must be non-null).
However, this can be problematic for foreign keys, which
may need to be null on occasion, in which case the second
rule should be added.
Thoughts?
-jkw
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".