Created
May 7, 2015 06:39
-
-
Save dingbuoyi/643e0a809755ab932439 to your computer and use it in GitHub Desktop.
test code for GreedDao
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(this, "notes-db", null); | |
| db = helper.getWritableDatabase(); | |
| daoMaster = new DaoMaster(db); | |
| daoSession = daoMaster.newSession(); | |
| boxDao = daoSession.getBoxDao(); | |
| Box box = new Box(null, "魔方", 1, "魔方描述"); | |
| boxDao.insert(box); | |
| Logger.d("Inserted new note, ID: " + box.getId()); | |
| List<Box> boxList = boxDao.queryBuilder().list(); | |
| if (CollectionUtils.isNotEmpty(boxList)) { | |
| Logger.d("query box :" + boxList.get(0).toString()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment