Is there a way to have the spring binding mechanism update bean properties only if they are different from the current property value?
The problem I'm facing is the following :
I have an editable table in my JSP where I bind the rows to a POJO collection. I use Hibernate for persistence. When a user changes a couple of entries and hits save, in my controller I iterate over all objects in the collection and call Hibernates saveOrUpdate(o) through a service API.
The problem is that when my table size is 100 rows and the user edits just one row and clicks save, after Spring MCV binding, all objects are marked dirty and 100 update queries are issued by Hibernate instead of just one.
I could have sworn that in some earlier version of Spring I was seeing the desired behaviour (where only modified objects are updated) but in Spring 1.2 RC2, all objects are updated and I incur a huge performance hit.