Joined: Tue Apr 04, 2006 6:58 am Posts: 4 Location: Tampere,Finland
|
Caused by: org.hibernate.HibernateException: identifier of an instance of <class> altered from <x> to <y>
This is caused, spare from you actually doing the ID change, from using f.ex. 'int' instead of 'Integer' as object id.
So, if your code looks like this:
public class HibernateObject {
private int id;
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
}
You will have to change it to:
public class HibernateObject {
private Integer id;
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
}
And it works. In my humble opinion this is very silly behaviour, but I guess there is a reason why it works like this.
Hope this helps someone.
|
|