Why entity's bean primary key can't be primitive?
javax.ejb.EJBObject and javax.ejb.EJBLocalObject both have a method 'getPrimaryKey' that returns an Object that you can cast to the type of your primary key. A primitive isn't an Object. You could also come up with a whole host of reasons why primitives would make life hell for the container vendor.
Why should I ... return null in ejbCreate(...)?
Remember that the spec has to cover both CMP (on exam) and BMP (not on exam) use of entity beans. BMP beans return the PK because the container has no other was of getting the primary key. CMP returns null because the container doesn't get the PK from the return result. The PK is constructed by the container via the attribute values you sent in ejbCreate() and reflection based on the prim-key-class and/or primkey-field content of the DD. Strictly speaking the
Java code in a CMP bean may have no reason to be aware of the definition of its PK at all.