A. I would say this is sometimes, but not always, true. The primary key can be one of the the CMP fields. In this case, you can specify its type as String
, Integer, etc., and you must specify the primary key field. On the other hand, you can also define a primary key class consisting of one or more of the CMP fields. In that case, you don't specify the primary key field(s) in the DD, only the primary key class.
B. True. The primary key can be a String or wrapper type, or it can by a user-defined primary key class, but it must be an Object. It can never be a primitive.
C. True. The return type of the ejbCreate method must be the primary key type. For CMPs, the bean provider returns null, but the return type
is still the primary key type: String, Integer, custom PK class, etc.
I think I've got that all right. So, that makes D nearly right, but not quite. E is definitely wrong. What mock exam is this from?