Back to project page FrameLite.
The source code is released under:
GNU General Public License
If you think the Android project FrameLite listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.miku.framelite.api.database; /*from w ww .j av a2 s. co m*/ import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import com.miku.framelite.api.BaseRequest; import com.miku.framelite.api.RetResult; public abstract class AbstractDatabaseRequest<T,V> extends BaseRequest<T, V> { private SQLiteOpenHelper mHelper; public AbstractDatabaseRequest(SQLiteOpenHelper helper){ mHelper=helper; } /** * ????????{@link DatabaseType#READABLE}?{@link DatabaseType#WRITABLE} * @return */ protected abstract DatabaseType getDatabaseType(); protected abstract V doToDatabase(RetResult<T> result,SQLiteDatabase db); @Override public V doInBackground(RetResult<T> result) { SQLiteDatabase db=getDatabaseType()==DatabaseType.READABLE?mHelper.getReadableDatabase():mHelper.getWritableDatabase(); return doToDatabase(result,db); } }