Index: src/main/java/com/avaje/ebeaninternal/server/persist/dml/DeleteHandler.java===================================================================--- src/main/java/com/avaje/ebeaninternal/server/persist/dml/DeleteHandler.java (revision 949)+++ src/main/java/com/avaje/ebeaninternal/server/persist/dml/DeleteHandler.java (working copy)@@ -24,6 +24,7 @@ import com.avaje.ebeaninternal.api.SpiTransaction; import com.avaje.ebeaninternal.server.core.PersistRequestBean;+import com.avaje.ebeaninternal.server.deploy.BeanProperty; import com.avaje.ebeaninternal.server.type.DataBind; /**@@ -80,4 +81,16 @@ persistRequest.postExecute(); return rowCount; }++++ @Override+ public boolean isIncluded(BeanProperty prop) {++ return prop.isDbUpdatable() && super.isIncluded(prop);+ }++ public boolean hasChangedColumns() {+ return true;+ } }Index: src/main/java/com/avaje/ebeaninternal/server/deploy/id/ImportedIdSimple.java===================================================================--- src/main/java/com/avaje/ebeaninternal/server/deploy/id/ImportedIdSimple.java (revision 949)+++ src/main/java/com/avaje/ebeaninternal/server/deploy/id/ImportedIdSimple.java (working copy)@@ -110,15 +110,17 @@ public void dmlWhere(GenerateDmlRequest request, Object bean){ - Object value = null;- if (bean != null){- value = getIdValue(bean);- }- if (value == null){- request.appendColumnIsNull(localDbColumn);- } else {- request.appendColumn(localDbColumn);- }+ if (this.owner.isDbUpdatable()) {+ Object value = null;+ if (bean != null) {+ value = getIdValue(bean);+ }+ if (value == null) {+ request.appendColumnIsNull(localDbColumn);+ } else {+ request.appendColumn(localDbColumn);+ }+ } } public boolean hasChanged(Object bean, Object oldValues) {
Effectively this patch is adding additional prop.isDbUpdatable() checks.
I'm happy with these changes so applying the patch.