先用load方法取得po XXXBean b = session.load(XXXBean.Class, id); 然后用set方法设置主键的新属性 b.setId(newId); 最后用update()方法更新 session.update(b);