Re: When is the @Version field of a 'parent' entity updated?

2014-06-02 Thread Rupert Smith
On 2 June 2014 14:46, Albert Lee wrote: > @Version is used to support optimistic locking semantics at the object > level and bear no implication to db row or ownership. > > "In what circumstances would the Parent version be bumped by one?" > > When an entity is changed and needs to be updated bac

Re: When is the @Version field of a 'parent' entity updated?

2014-06-02 Thread Albert Lee
@Version is used to support optimistic locking semantics at the object level and bear no implication to db row or ownership. "In what circumstances would the Parent version be bumped by one?" When an entity is changed and needs to be updated back to the database row, the version field must be inc

When is the @Version field of a 'parent' entity updated?

2014-06-02 Thread Rupert Smith
Hi, I have classes mapped like this: class Parent { @Id int parentId; @Version int version; @OneToMany(...) List children; } class Child { @Id int childId; ... // no relationship to parent, its uni-directional } The foreign key is on the CHILD table, but in JPA par