#482 - ENH: @Draftable - Save or update is not allowed on a 'live' bean - only draft beans ... add this check when @Draft property is used

This commit is contained in:
Robin Bygrave committed 2015-12-07 12:09:10 +13:00
1 parent ff8e5af4e5
commit f42be3d65a
3 files changed
+24

No files matched your search

@@ -2002,6 +2002,17 @@ public class BeanDescriptor<T> implements MetaBeanInfo, SpiBeanType<T> {
}
}
/**
* Return true if the bean is considered a 'draft' instance.
*/
public boolean isDraftInstance(EntityBean entityBean) {
if (draft != null) {
return Boolean.TRUE == draft.getValue(entityBean);
}
// no draft property - so just ignore the check / return true
return true;
}
/**
* If there is a @DraftDirty property set it's value on the bean.
*/