PK in BMP

I have a question about primary keys in BMP beans. In some sample codes, Ihave seen that the primary key is kept in a PK class and there is no fieldin the bean class itself for the primary key. But in some other codes, thereIS a field corresponding to the primary key in the bean class in addition tothe PK class.

Now my question is: How can the container associate these two primary keys?How can it now that the field id in the bean class is PK? This associationis not mentioned in deployment descriptor, because we have just the<prim-key-class>PersonPK</prim-key-class> there.

The first thing that comes to mind is that in EJBLoad() we usectx.getPrimaryKey() to get the primary key stored in PersonPK and store itin the field "id". But consider this case:

Suppose that our key is 1 and hence both "ctx.getPrimaryKey().PersonID" andthe field "id" in the bean class evaluate to 1. Then we call setID(20) onthe bean class.

This will change the value of the field "id" to 20, but what will be thevalue of "ctx.getPrimaryKey().PersonID" ? Will it change too? If yes, how?How the container knows that "id" is a special field and its changes shouldbe reflected to the PersonPK object stored in the entity context?