I had one PO for example Person and the key is Long id;
Then I mannully called person.setId(0);
I thought then if the id is 0, Hibernate will set the id;
Howevere, it didn't and the Exception happended.
Then I deleted the code to set id to 0 and it worked OK.