I agree what you said, because it is following the EJB specification, but
from the usability standpoint, it is always desirable to define constants
you use throughout the code at one place. Because Java doesn't allow
#define, the only way is to declare them as a static final variables. To get
around the specification it is possible to move the constants into separate
interface implemented by the primary key class, but then, when you fix the
other problem I have found (derived primary key class) it may reappear
again. Do you have some other suggestion, how to deal with constants in
primary key classes?

Regards,

Miro

-----Original Message-----
From: Helene JOANIN [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 09, 1999 3:58 AM
To: Halas, Miroslav
Cc: '[EMAIL PROTECTED]'; Helene JOANIN
Subject: Re: Primary Key class problem


Halas, Miroslav wrote:
> 
> Hi,
> 
> I have a primary key class for EntityBean, which contains several public
and
> protected static member variables (numbers and texts used as constants)
all
> marked as transient. When I use GenIC, I get an error:
> 
> GenIC ERROR: The field [name of the public/protected static final member
> variable] of the Primary Key class is not a container-managed field of the
> Entity Bean
> 
> This code works with Weblogic 4.5.1 so I am wondering if it is a bug in
> Jonas?
> 

Hi,

We can find in the specification of EJB version 1.0 chapter 9.10.7,
and in the specification of EJB version 1.1 chapter 9.4.7.2,
the following sentences about the primary key class of an entity
bean with container-managed persistence :

        All fields in the primary key class must be declared as public.

        The names of the fields in the primary key class must be a subset
        of the names of the container-managed fields. (This allows the
        container to extract the primary key fields from an instance's
        container-managed fields, and vice versa.)

That's why we think it's not a bug in JOnAS.
Are you agree ?

Best regards.
H�l�ne.
-- 
-=- H�l�ne JOANIN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  mailto:[EMAIL PROTECTED]    http://www-frec.bull.com
  Phone: 33.4.76.29.73.53          Fax: 33.4.76.29.76.00
 Download our EJB Server JOnAS at http://www.bullsoft.com/ejb
_______________________________________________________________

Reply via email to