final MethodAccessor methodAccessor = newMethodAccessor(method);
return new Setter() {
public void setProperty(Object obj, Object value) {
if (value == null && type.isPrimitive()) return;
try {
methodAccessor.invoke(obj, new Object[]{value});
} catch (InvocationTargetException e) {
throw new Sql2oException("error while calling setter method with name " + method.getName() + " on class " + obj.getClass().toString(), e);
}
}