实例教程七:在SQLite中使用事务
生活随笔
收集整理的這篇文章主要介紹了
实例教程七:在SQLite中使用事务
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
系統(tǒng)文件管理器
http://www.eoeandroid.com/thread-128567-1-1.html
android 實(shí)現(xiàn)區(qū)域截圖
http://www.eoeandroid.com/thread-149439-1-1.html
影院選坐 寫著玩的
http://www.eoeandroid.com/thread-151980-1-1.html
繼上章
1.在數(shù)據(jù)庫表person添加字段amount
2.在Person類中添加相應(yīng)的amount
3.在PersonService添加payment()方法
4.初始化amount值,便于調(diào)用
public void testUpdateAmount() throws Exception{PersonService service = new PersonService(this.getContext());Person person1 = service.find(1);Person person2 = service.find(2);person1.setAmount(100);person2.setAmount(200);service.update(person1);service.update(person2);}5.在單元測試類PersonServiceTest中添加測試方法testPayment()
public void testPayment() throws Exception{PersonService service = new PersonService(this.getContext());service.payment();}?
?
?
與50位技術(shù)專家面對面20年技術(shù)見證,附贈(zèng)技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的实例教程七:在SQLite中使用事务的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 结束SQL阻塞的进程
- 下一篇: linux cmake编译源码,linu