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