/** * Set resource ID. * * @param id resource id */ public void setId(String id) { this.setValue(dictionary.getIdFieldName(getResourceClass()), id); }
/** * Set resource ID. * * @param id resource id */ public void setId(String id) { this.setValue(dictionary.getIdFieldName(getResourceClass()), id); }
/** * Sets value. * @param fieldName the field name * @param newValue the new value */ protected void setValueChecked(String fieldName, Object newValue) { Object existingValue = getValueUnchecked(fieldName); ChangeSpec spec = new ChangeSpec(this, fieldName, existingValue, newValue); boolean isNewlyCreated = requestScope.getNewPersistentResources().contains(this); // TODO: Need to refactor this logic. For creates this is properly converted in the executor. This logic // should be explicitly encapsulated here, not there. checkFieldAwareDeferPermissions(UpdatePermission.class, fieldName, newValue, existingValue); setValue(fieldName, newValue); }
/** * Sets value. * @param fieldName the field name * @param newValue the new value */ protected void setValueChecked(String fieldName, Object newValue) { Object existingValue = getValueUnchecked(fieldName); ChangeSpec spec = new ChangeSpec(this, fieldName, existingValue, newValue); boolean isNewlyCreated = requestScope.getNewPersistentResources().contains(this); // TODO: Need to refactor this logic. For creates this is properly converted in the executor. This logic // should be explicitly encapsulated here, not there. checkFieldAwareDeferPermissions(UpdatePermission.class, fieldName, newValue, existingValue); setValue(fieldName, newValue); }
this.setValue(fieldName, mine);
this.setValue(fieldName, mine);
.filter(relationName -> newResource.getRelationshipType(relationName).isToMany() && newResource.getValueUnchecked(relationName) == null) .forEach(relationName -> newResource.setValue(relationName, new LinkedHashSet<>()));
.filter(relationName -> newResource.getRelationshipType(relationName).isToMany() && newResource.getValueUnchecked(relationName) == null) .forEach(relationName -> newResource.setValue(relationName, new LinkedHashSet<>()));