HospitalStaffDAO hdao = new HospitalStaffDAO();
HospitalStaffId id = new HospitalStaffId();
id.setHospital("zs001");
id.setStaffSn("st05");
HospitalStaff hs = hdao.findById(id);
Class c = hs.getClass();
Method m[] = c.getDeclaredMethods();
log.fatal("set前");
for (int i = 0; i < m.length; i++) {
if (m[i].getName().indexOf("get") == 0) {
log.fatal("方法名:" + m[i].getName() + "--值:"
+ m[i].invoke(hs, new Object[0]));
}
}
遍历POJO
最新推荐文章于 2022-06-16 03:12:07 发布