I\'ve got those two classes
MyItem Object:
@Entity
public class MyItem implements Serializable {
@Id
private Integer id;
@ManyToOne(casc
Same here, check your equals() method. Most probably is badly implemented.
Edit: I have verified that a merge operation will not work if you don't implement your Entity's equals() and hashCode() methods correctly.
You should follow these guidelines for implementing equals() and hashCode():
http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html/ch04.html#persistent-classes-equalshashcode
"It is recommended that you implement equals() and hashCode() using Business key equality. Business key equality means that the equals() method compares only the properties that form the business key. It is a key that would identify our instance in the real world (a natural candidate key)"
That means: You should NOT use your Id as part of your equals() implementation!