当前位置:网站首页 > 技术博客 > 正文

greendao数据库升级



@Override public void insertData(Thing s) { DaoSession daoSession = ((AserbaoApplication) getApplication()).getDaoSession(); for (int i = 0; i < 1000; i++) { Student student = new Student(); student.setStudentNo(i); int age = mRandom.nextInt(10) + 10; student.setAge(age); student.setTelPhone(RandomValue.getTel()); String chineseName = RandomValue.getChineseName(); student.setName(chineseName); if (i % 2 == 0) { student.setSex("男"); } else { student.setSex("女"); } student.setAddress(RandomValue.getRoad()); student.setGrade(String.valueOf(age % 10) + "年纪"); student.setSchoolName(RandomValue.getSchoolName()); daoSession.insertOrReplace(student);//插入或替换  } } 

  • 上一篇: xml中注释的写法
  • 下一篇: ajax请求写法
  • 版权声明


    相关文章:

  • xml中注释的写法2025-03-29 09:30:03
  • js数组方法有哪些2025-03-29 09:30:03
  • 破除压缩文件密码2025-03-29 09:30:03
  • join关键字指定的连接2025-03-29 09:30:03
  • linter pylint is not installed2025-03-29 09:30:03
  • ajax请求写法2025-03-29 09:30:03
  • fopen函数使用2025-03-29 09:30:03
  • libcurl.lib2025-03-29 09:30:03
  • 动态路由协议rip协议是怎样的?2025-03-29 09:30:03
  • 卷积时延特性2025-03-29 09:30:03