I receive the following exception when I'm trying to alter my @ID
in an @Entity
.
identifier of an instance of com.google.search.pagerank.ItemEntity was altered from 1 to 2.
I know that I'm altering the primary key in my table. I'm using JPA-annotations.
I solved this by using this single HQL query: update Table set name=:newName where name=:oldName
Instead of using the more OO approach:
beginTransaction();
T e = session.load(...);
e.setName(newName);
session.saveOrUdate(e);
commit();
Any idea what the diff is?