As in case of primitive type primary key attribute, there is no need to specify the seperate primary key class. And we can specify that directly in the deployment descriptor , Then in that case what will the return type of the ejbCreate() method in the entity bean's class.
The primary key attribute of an EJB can't be a primitive type. You must use a wrapper(java.lang.Integer in this case) to substitute those primitives, as you need to provide a serializable class.
regards,
Fred
Frederico Melo<br />--------------<br />Software Architect<br />Sun Certified Enterprise Architect for J2EE<br />IBM Rational Unified Process Specialist
The primary key type must be a legal Value Type in RMI-IIOP. My understanding is that a primitive is such a legal value.
Furthermore, you only need a (Serializable) primary key class where the primary key maps to multiple fields in the entity bean class. If you always had to have a primary key class, you would be compelled to convert a single key field into an object by wrapping it in your primary key class.
The bean provider must specify a primary key class in the deployment descriptor The class must provide suitable implementation of hashcode() and equals() methods to simplify the management of primary key to the container."
For me, primitives are not classes nor implement hashcode() and equals()..
if anyone can call 13.equals(12) or 25.hashcode() please tell me.
Frederico Melo<br />--------------<br />Software Architect<br />Sun Certified Enterprise Architect for J2EE<br />IBM Rational Unified Process Specialist
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.