Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Clarify the relation between SQLiteContentProviderImpl and ExtendedSQLiteOpenHelper #67

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public SQLiteContentProviderImpl() {
@Override
public boolean onCreate() {
super.onCreate();
helper = new InsertHelper((ExtendedSQLiteOpenHelper) getDatabaseHelper());
helper = new InsertHelper(getDatabaseHelper());
return true;
}

Expand All @@ -52,7 +52,7 @@ protected SQLiteDatabase getReadableDatabase() {
}

@Override
protected SQLiteOpenHelper getDatabaseHelper(Context context) {
protected ExtendedSQLiteOpenHelper getDatabaseHelper(Context context) {
try {
return new ExtendedSQLiteOpenHelper(context, getCursorFactory());
} catch (IOException e) {
Expand All @@ -61,6 +61,11 @@ protected SQLiteOpenHelper getDatabaseHelper(Context context) {
}
}

@Override
protected ExtendedSQLiteOpenHelper getDatabaseHelper() {
return (ExtendedSQLiteOpenHelper) super.getDatabaseHelper();
}

@Override
protected Uri insertInTransaction(Uri uri, ContentValues values) {
Uri insertUri = insertSilently(uri, values);
Expand Down Expand Up @@ -148,7 +153,7 @@ public Cursor query(Uri uri, String[] projection, String selection, String[] sel

if (expands.size() > 0) {
builder.addInnerJoin(expands.toArray(new String[]{}));
ExtendedSQLiteOpenHelper extendedHelper = (ExtendedSQLiteOpenHelper) getDatabaseHelper();
ExtendedSQLiteOpenHelper extendedHelper = getDatabaseHelper();
autoproj = extendedHelper.getProjectionMap(tableName.toString(), expands.toArray(new String[]{}));
builder.setProjectionMap(autoproj);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ protected ExtendedSQLiteQueryBuilder getSQLiteQueryBuilder() {
}

@Override
protected SQLiteOpenHelper getDatabaseHelper(Context context) {
protected ExtendedSQLiteOpenHelper getDatabaseHelper(Context context) {
try {
return new ExtendedSQLiteOpenHelper(getContext()) {
@Override
Expand Down