public static void initHelper(Context context) { if (helper == null) { helper = new OrmliteDbHelper(context); dbConnection = new AndroidDatabaseConnection(helper.getWritableDatabase(), true); } }
/** * 功能描述:获取实体类的DAO实例 * * @param <D> * @param <T> * @param context * @param clazz * @return * @throws SQLException */ public static <D extends com.j256.ormlite.dao.Dao<T, ?>, T> D getDao( Context context, Class<T> clazz) throws SQLException { return helper.getDao(clazz); }