views:

71

answers:

1

Hi there,

When calling persist the setId method never gets called which in turns causes the firePropertyChange not to execute. I need to fire the changeSupport method because I have functionality that dependants on the state of my entity.

public void setId(Long id) {
    Long oldId = this.id;
    this.id = id;
    changeSupport.firePropertyChange("id", oldId, id);
}
A: 

This is most probably because you annotated the id field and not the setter or getter.

At least Hibernate will use this as an indicator to use direct field access instead of the setters.

Jens Schauder