I have an entity bean CustomerBean. It has a customerid String field which is also its primary key. Can I have a setCustomerId(String id) method in the remote interface of this bean? I couldn't find anything in the spec that restricts this. If I am able to change the customerid (thereby changing the primary key), does it not amount to changing the identity of the entity bean? It should not be allowed, right? Any thoughts please?
This method will be used to set the id in ejbCreate() method. You don't have to expose it in the interface. Again, it's only a 'by-contract' rule, so technically nothing will stop you if you decide for some weird reason to do it.