我有一个问题:找不到只有辅助类的(上下文)参数的构造函数......
class ORMDBHelper extends OrmLiteSqliteOpenHelper {
private EventDAO mMyDao;
public ORMDBHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db, ConnectionSource connectionSource) {
try {
TableUtils.createTable(connectionSource, MyClass.class);
} catch (SQLException e) {
e.printStackTrace();
}
}
@Override
public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource,
int oldVersion, int newVersion) {
try {
TableUtils.dropTable(connectionSource, MyClass.class, true);
onCreate(db, connectionSource);
} catch (SQLException e) {
e.printStackTrace();
}
}
public EventDAO getEventDAO() throws SQLException {
if (mMyDao == null) {
mMyDao = new MyDAO(getConnectionSource(), MyClass.class);
}
return mMyDao;
}
public void clearTable(Class dataClass) throws SQLException {
TableUtils.clearTable(getConnectionSource(), dataClass);
}
@Override
public void close() {
super.close();
mMyDao = null;
}
}
错误所在的行:
mDbHelper = OpenHelperManager.getHelper(context, ORMDBHelper.class);
我找到了一些答案,但它们是混淆的解决方案。