save(Object entity)
引數說明:public static void main(String[] args){ ApplicationContext context = new ClassPathXmlApplicationContext("cfg/XMLConfig.xml");//載入組態檔 Dao dao = (Dao)context.getBean("dao"); //建立Dao TbUser user = new TbUser(); user.setName("明日"); user.setSex("男"); user.setAge(20); dao.getHibernateTemplate().save(user); //執行儲存方法 }