測試 update 以及 delete方法
為什么會 測試update 。控制臺輸出
Hibernate:?
? ? select
? ? ? ? students0_.SID as SID1_0_0_,
? ? ? ? students0_.SNAME as SNAME2_0_0_,
? ? ? ? students0_.GENDER as GENDER3_0_0_,
? ? ? ? students0_.BIRTHDAY as BIRTHDAY4_0_0_,
? ? ? ? students0_.POSTCODE as POSTCODE5_0_0_,
? ? ? ? students0_.PHONE as PHONE6_0_0_,
? ? ? ? students0_.ADDRESS as ADDRESS7_0_0_?
? ? from
? ? ? ? STUDENTS students0_?
? ? where
? ? ? ? students0_.SID=?
Students [sid=1, sname=哈哈, gender=男, birthday=2016-12-22 14:50:08.0]
修改的是?
s.setGender("男");
?可是 數據庫里卻沒有發生改變呢??
2017-05-24
檢查session.update()之前有沒有 開啟transaction(事物),在update之后有沒有transaction.commit();(提交事務)
2017-02-09
修改后要執行session.update(),控制臺會輸出update語句的
2016-12-22
你這個不是select嗎