Actually, according to the JPA specification it is forbidden to change a primary key:
The application must not change the value of the primary key[8]. The behavior is undefined if this occurs.[9]
(from EJB 3 persistence (JPA) specification, paragraph 2.1.4)