Пример #1
0
 public DBCarInfo(Context context) {
   super();
   /** 如果数据库有变动,一定要更新版本 */
   WSql.updateVersion(2);
   WSql.addTable(CarInfo.class);
   initHelper(context);
   initCarInfoDao();
 }
Пример #2
0
 public void deleteAll() {
   try {
     TableUtils.clearTable(helper.getConnectionSource(), CarInfo.class);
   } catch (SQLException e) {
     e.printStackTrace();
   }
 }
Пример #3
0
  public synchronized void initCarInfoDao() {

    if (carInfoDao == null) {
      try {
        carInfoDao = helper.getDao(CarInfo.class);
      } catch (SQLException e) {
        e.printStackTrace();
      }
    }
  }