/** * Updates the entity with the values you previously set using the setter * methods, and any additional specified arguments. The specified arguments * take precedent over the values that were set using the setter methods. * * @param args The arguments to update. */ public void update(Map<String, Object> args) { if (!toUpdate.isEmpty() || !args.isEmpty()) { // Merge cached setters and live args together before updating. Map<String, Object> mergedArgs = new LinkedHashMap<String, Object>(); mergedArgs.putAll(toUpdate); mergedArgs.putAll(args); if (mergedArgs.containsKey("name") && !isNameChangeAllowed()) { throw new IllegalStateException("Cannot set 'name' on an existing entity."); } service.post(actionPath("edit"), mergedArgs); toUpdate.clear(); invalidate(); } }