s,t為對象
BeanUtils.copyProperties(s, t); 將給定源bean的屬性值復制到目標bean中
public static void copyProperties(Object source, Object target) //source 源,target 目標 throws BeansException { copyProperties(source, target, null, (String[]) null); }
BeanUtils.copyProperties(s, t, "Id", "Time"); 將給定源bean的屬性值復制到目標bean中,忽略Id和Time屬性
public static void copyProperties(Object source, Object target, String... ignoreProperties) //source 源,target 目標, ignoreProperties 要忽略的屬性名稱數組 throws BeansException { copyProperties(source, target, null, ignoreProperties); }