Hi,
I am getting unexpected Update statements when doing simple selects.
It only occurs on one-to-many relationships.
For example, I do a hibernateTemplate.get(class, id) on the parent object. When the session commits, I notice a whole bunch of update statements being run on the children.
It happens on all of our parent-children classes.
Obviously something is getting changed and Hibernate is rightly detecting it, then doing the update. But I can't figure out what is making the change.
Doing a direct get/select on the child does not cause updates, so I don't think it's a problem with the getters/setters on the individual class.
The mapping looks like:
Code:
private List<SkuOptionDO> skuOptionList = new ArrayList<SkuOptionDO>();
@OneToMany(mappedBy = "skuType", cascade={CascadeType.ALL})
public List<SkuOptionDO> getSkuOptionList() {
return skuOptionList;
}
public void setSkuOptionList(List<SkuOptionDO> skuOptionList) {
this.skuOptionList = skuOptionList;
}
Any ideas what could be causing the updates on the collection?
Thanks.
Hibermate 3.2.0
Java 1.5.0_11
MySQL 5.0