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.ja v a2s . c om import android.content.Context; import com.j256.ormlite.android.apptools.OpenHelperManager; import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper; import com.miku.framelite.api.BaseRequest; import com.miku.framelite.api.RetResult; public abstract class AbstractOrmDatabaseRequest<T,V> extends BaseRequest<T, V> { private Class<? extends OrmLiteSqliteOpenHelper> helplerClass; private Context mContext; public AbstractOrmDatabaseRequest(Context context,Class<? extends OrmLiteSqliteOpenHelper> helplerClass){ mContext=context; this.helplerClass=helplerClass; } protected abstract V doToDatabase(RetResult<T> result,OrmLiteSqliteOpenHelper helper); @Override public V doInBackground(RetResult<T> result) { V ret= doToDatabase(result,getHelper()); OpenHelperManager.releaseHelper(); return ret; } private OrmLiteSqliteOpenHelper getHelper(){ return OpenHelperManager.getHelper(mContext, helplerClass); } }