MCPcopy Create free account
hub / github.com/wyouflf/xUtils3 / dropDb

Method dropDb

xutils/src/main/java/org/xutils/db/table/DbBase.java:49–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47 }
48
49 @Override
50 public void dropDb() throws DbException {
51 Cursor cursor = execQuery("SELECT name FROM sqlite_master WHERE type='table' AND name<>'sqlite_sequence'");
52 if (cursor != null) {
53 try {
54 while (cursor.moveToNext()) {
55 try {
56 String tableName = cursor.getString(0);
57 execNonQuery("DROP TABLE " + tableName);
58 } catch (Throwable e) {
59 LogUtil.e(e.getMessage(), e);
60 }
61 }
62
63 synchronized (tableMap) {
64 for (TableEntity<?> table : tableMap.values()) {
65 table.setTableCheckedStatus(false);
66 }
67 tableMap.clear();
68 }
69 } catch (Throwable e) {
70 throw new DbException(e);
71 } finally {
72 IOUtil.closeQuietly(cursor);
73 }
74 }
75 }
76
77 @Override
78 public void addColumn(Class<?> entityType, String column) throws DbException {

Callers

nothing calls this directly

Calls 8

eMethod · 0.95
closeQuietlyMethod · 0.95
getStringMethod · 0.80
getMessageMethod · 0.80
setTableCheckedStatusMethod · 0.80
clearMethod · 0.80
execQueryMethod · 0.65
execNonQueryMethod · 0.65

Tested by

no test coverage detected