This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
If you provide the setter methods in client view, assume the client trying to change the primary key means, for the updation purpose( i mean Bean to DB) the container couldn't find the primary for the bean, it resultant that a container would throw an exception.
So the conclusion is you can keep the setter methods in client view, it never disturb compilation and deployment process, but it would throw an exception while you calling in the client view.
So never disclosure your primary key fileds setter methods. It is not encouraged. Thats all.
Once the primary key for an entity bean has been set, the Bean Provider must not attempt to change it by use of set accessor methods on the primary key cmp-fields. The Bean Provider should therefore not expose the set accessor methods for the primary key cmp-fields in the component interface of the entity bean.
Although it won;t thown an exception if you expose the setter method but it is not a good practice.
Sawan<br />SCJP,SCWCD,SCBCD<br /> <br />Every exit is an entry somewhere.