|
Problem is reproduced only if associated many-to-one property set to null I have tree:
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Entity
public class Territory{
..
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@OneToMany(mappedBy = "parent")
public List<Territory> getChildren() {...}
@ManyToOne(fetch = FetchType.LAZY)
public Territory getParent(){...}
}
...
If parent = null , on save
int i = persister.getEntityMetamodel().getPropertyIndex( mappedBy ); Serializable oldId = null;
if ( oldState != null ) {
oldId = session.getIdentifier( oldState[i] );
I suggest to add condition for check null
|