Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public Single<List<Questions>> getQuestions() {
- final String _sql = "SELECT * FROM questions_table";
- final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 0);
- return Single.fromCallable(new Callable<List<Questions>>() {...}
- }
- @Override
- public Flowable<List<Integer>> getCountAnswers(final int quizId, final boolean isAddQuest) {
- final String _sql = "SELECT count(id) FROM main_quiz_table WHERE quiz_id = ? AND add_question = ? AND user_ans_id > 0";
- final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 2);
- int _argIndex = 1;
- _statement.bindLong(_argIndex, quizId);
- _argIndex = 2;
- final int _tmp;
- _tmp = isAddQuest ? 1 : 0;
- _statement.bindLong(_argIndex, _tmp);
- return RxRoom.createFlowable(__db, new String[]{"main_quiz_table"}, new Callable<List<Integer>>() {...}
- }
- @Override
- public Single<List<Questions>> getQuestions() {final String _sql = "SELECT * FROM questions_table";
- final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 0);
- return RxRoom.createSingle(new Callable<List<Questions>>() {...}
- }
- @Override
- public Flowable<List<Integer>> getCountAnswers(final int quizId, final boolean isAddQuest) {
- final String _sql = "SELECT count(id) FROM main_quiz_table WHERE quiz_id = :quizId AND add_question = :isAddQuest AND user_ans_id > 0";
- final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 2);
- int _argIndex = 1;
- _statement.bindLong(_argIndex, quizId);
- _argIndex = 2;
- final int _tmp;
- _tmp = isAddQuest ? 1 : 0;
- _statement.bindLong(_argIndex, _tmp);
- return RxRoom.createFlowable(__db, false, new String[]{"main_quiz_table"}, new Callable<List<Integer>>() {...}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement