update(Object entity)
引數說明:public static void main(String[] args){ ApplicationContext context = new ClassPathXmlApplicationContext("cfg/XMLConfig.xml"); //載入組態檔 Dao dao = (Dao)context.getBean("dao"); //建立Dao HibernateTemplate htm = dao.getHibernateTemplate(); TbUser user = (TbUser)htm.get(TbUser.class,1); user.setAge(user.getAge()+1); htm.update(user); }