Mongodb 在update时 org.springframework.data.mapping.context.InvalidPersistentPropertyPath: No property

来源:互联网 发布:手机主题桌面软件 编辑:程序博客网 时间:2024/05/17 08:29
是因为在
private Update buildBaseUpdate(T t) {    Update update = new Update();    Field[] fields = t.getClass().getDeclaredFields();    for (Field field : fields) {        field.setAccessible(true);        try {            Object value = field.get(t);            if (value != null) {                update.set(field.getName(), value);            }        } catch (Exception e) {            e.printStackTrace();        }    }    return update;

} 时 将

private static final long serialVersionUID 也作为一个字段  从而出现上述错误!   去掉就没事了!

0 0
原创粉丝点击