采用反射机制,得出属性是否忽略

    /**
     *  忽略以下属性:不可读写/value是集合/value类型是DomainImpl的任何一级子类
     */
    private static boolean isBeanPropertyIgnore(BeanMap beanMap, Map<String, Object> params, String key) {
        if (beanMap.getWriteMethod(key) == null) return true;

        Object value = params.get(key);
        if (value instanceof Collection) return true;

        Method method = beanMap.getReadMethod(key);
        if (method == null) return true;
        if (DomainImpl.class.isAssignableFrom(method.getReturnType())) return true;

        return false;
    }
原文地址:https://www.cnblogs.com/zhiqsyr/p/12061167.html