Support has been added for updating only the properties that have been changed (as opposed to the loaded properties).
This can be set globally or on a entity by entity basis with an UpdateMode annotation.
To turn this on globally, in ebean.properties:
ebean.updateChangesOnly=true
This change is in HEAD.
The reson is, that in UpdateHandler.isIncluded now the check honors the updatedProerties only, and the version column has not been updated.
I think the version column needs to be included always in the update, which I did locally using this patch:
Index: ../ebean/src/com/avaje/ebean/server/persist/dml/UpdateHandler.java===================================================================--- ../ebean/src/com/avaje/ebean/server/persist/dml/UpdateHandler.java (revision 218)+++ ../ebean/src/com/avaje/ebean/server/persist/dml/UpdateHandler.java Tue Apr 28 14:25:43 CEST 2009@@ -86,7 +86,7 @@ @Override public boolean isIncluded(BeanProperty prop) {- return (updatedProperties == null || updatedProperties.contains(prop.getName()));+ return prop.isVersion() || (updatedProperties == null || updatedProperties.contains(prop.getName())); } }
Updated to include Mario's change (to include the version property).
Also made some more updates around embedded beans.
Note: currently there is not support for 'partially populated' embedded beans.