I dont have the book with me now, but may be the reason it is invalid is because the return type should be the primary key class and not a primitive type??? So if the return type was Integer instead of int it would be valid then.
Sorry Michael my mistake, I had exactly the same question when I did the chapter. I replied ur question in haste, without checking taht it was an entity bean... Since it is mentioned that the primary key can be an integer or a string, i felt that teh choice was valid too, but that leaves the question whether they were talking about a wrapped Integer or a primitive int..
Neways, hope someone else can clear this up..
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, OCA (DBA)<br /> <br />Winners dont do different things. They do things differently...
I'm only starting to study for SCBCD, so I'm not sure this will help. But it is said that the prim-key-class element contains the fully-qualified name of an entity bean's primary key class. This should confirm what you are saying. Primitive types are not allowed. Wrapper classes should be used instead.
A simple way to reason out this : You need to return null from the ejbCreate () method of a CMP entity bean. You can't return null if the return type is a primitive. Hence the return type cannot be a primitive
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop