"Jonathan K. Weedon" wrote:
>
> 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.

If this is deprecated (although I can see no evidence of it myself) then it
is a big mistake.

I suspect that it is not deprecated. I would recommend the following pattern
for numeric primary keys:

public class MyPK
{
    int value;

    MyPK() { ... }

    // hashCode and equals ...
}

This is preferable to using java.lang.Integer as a primary key type as it gives
you better type safety (you can't accidentally pass an AccountKey where a
CustomerKey is expected).

<vendor>
We also permit entity components to have non-valuetype primary keys in our
product, but the mechanism is proprietary and so we leave it undocumented.
</vendor>
________________________________________________________________________________

Evan Ireland              Sybase EAServer Engineering        [EMAIL PROTECTED]
                            Wellington, New Zealand               +64 4 934-5856

===========================================================================
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".

Reply via email to