return ids[0];
}
@SuppressWarnings("rawtypes")
public static <T> T edit(ParamNode rootParamNode, String name, T o, Annotation[] annotations) {
ParamNode paramNode = rootParamNode.getChild(name, true);
// #1195 - Needs to keep track of whick keys we remove so that we can restore it before
// returning from this method.
List<ParamNode.RemovedNode> removedNodesList = new ArrayList<ParamNode.RemovedNode>();
try {
// Start with relations
Set<Field> fields = new HashSet<Field>();
Class clazz = o.getClass();
while (!clazz.equals(Object.class)) {
Collections.addAll(fields, clazz.getDeclaredFields());
clazz = clazz.getSuperclass();
}
for (Field field : fields) {
processField(field, paramNode, removedNodesList, o);
}
ParamNode beanNode = rootParamNode.getChild(name, true);
Binder.bindBean(beanNode, o, annotations);
return (T) o;
} catch (Exception e) {
throw new UnexpectedException(e);
} finally {