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

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