Interface ChallengeAttemptDao
-
public interface ChallengeAttemptDaoProvides an interface with methods that perform actions on theChallengeAttempttable of the database.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Single<Integer>delete(ChallengeAttempt attempt)Deletes a single attempt from the database.Single<Integer>delete(ChallengeAttempt... attempts)Deletes multiple attempts from the database.Single<Integer>delete(Collection<ChallengeAttempt> attempts)Deletes multiple attempts from the database.Single<Long>insert(ChallengeAttempt attempt)Inserts a single attempt into the database.Single<List<Long>>insert(ChallengeAttempt... attempts)Inserts multiple attempts into the database.Single<List<Long>>insert(Collection<ChallengeAttempt> attempts)Inserts multiple attempts into the database.LiveData<ChallengeAttempt>select(long id)Queries the database for a specific attempt, based on id.LiveData<List<ChallengeAttempt>>selectAll()Queries the database for all attempts.LiveData<List<ChallengeAttempt>>selectAllWithPlayer(long id)Queries the database for all attempts made by a specific player.LiveData<List<ChallengeAttemptWithPlayer>>selectHighScores(int numScores)Queries the database for the attempts with the highest scores.LiveData<List<ChallengeAttempt>>selectPlayerHighScores(long id, int numScores)Queries the database for the attempts with the highest scores made by a specific player.Single<Integer>update(ChallengeAttempt attempt)Updates a single attempt in the database.Single<Integer>update(ChallengeAttempt... attempts)Updates multiple attempts in the database.Single<Integer>update(Collection<ChallengeAttempt> attempts)Updates multiple attempts in the database.
-
-
-
Method Detail
-
insert
Single<Long> insert(ChallengeAttempt attempt)
Inserts a single attempt into the database.- Parameters:
attempt- The attempt to be inserted.- Returns:
- A
Singleholding the id of the attempt that was inserted.
-
insert
Single<List<Long>> insert(ChallengeAttempt... attempts)
Inserts multiple attempts into the database.- Parameters:
attempts- The attempts to be inserted.- Returns:
- A
Singleholding aListof ids of attempts that were inserted.
-
insert
Single<List<Long>> insert(Collection<ChallengeAttempt> attempts)
Inserts multiple attempts into the database.- Parameters:
attempts- The attempts to be inserted.- Returns:
- A
Singleholding aListof ids of attempts that were inserted.
-
update
Single<Integer> update(ChallengeAttempt attempt)
Updates a single attempt in the database.- Parameters:
attempt- The attempt to be updated.- Returns:
- A
Singleholding the number of updates performed.
-
update
Single<Integer> update(ChallengeAttempt... attempts)
Updates multiple attempts in the database.- Parameters:
attempts- The attempts to be updated.- Returns:
- A
Singleholding the number of updates performed.
-
update
Single<Integer> update(Collection<ChallengeAttempt> attempts)
Updates multiple attempts in the database.- Parameters:
attempts- The attempts to be updated.- Returns:
- A
Singleholding the number of updates performed.
-
delete
Single<Integer> delete(ChallengeAttempt attempt)
Deletes a single attempt from the database.- Parameters:
attempt- The attempt to be deleted.- Returns:
- A
Singleholding the number of deletions performed.
-
delete
Single<Integer> delete(ChallengeAttempt... attempts)
Deletes multiple attempts from the database.- Parameters:
attempts- The attempts to be deleted.- Returns:
- A
Singleholding the number of deletions performed.
-
delete
Single<Integer> delete(Collection<ChallengeAttempt> attempts)
Deletes multiple attempts from the database.- Parameters:
attempts- The attempts to be deleted.- Returns:
- A
Singleholding the number of deletions performed.
-
select
LiveData<ChallengeAttempt> select(long id)
Queries the database for a specific attempt, based on id.- Parameters:
id- The id of the attempt.- Returns:
LiveDataof the selected attempt.
-
selectAll
LiveData<List<ChallengeAttempt>> selectAll()
Queries the database for all attempts. Orders by most recent first.- Returns:
LiveDataof aListof attempts.
-
selectAllWithPlayer
LiveData<List<ChallengeAttempt>> selectAllWithPlayer(long id)
Queries the database for all attempts made by a specific player. Orders by most recent first.- Parameters:
id- The player's id.- Returns:
LiveDataof aListof attempts made by the specified player.
-
selectHighScores
LiveData<List<ChallengeAttemptWithPlayer>> selectHighScores(int numScores)
Queries the database for the attempts with the highest scores.- Parameters:
numScores- The number of scores to return.- Returns:
LiveDataof aListof high-scoring attempts.
-
selectPlayerHighScores
LiveData<List<ChallengeAttempt>> selectPlayerHighScores(long id, int numScores)
Queries the database for the attempts with the highest scores made by a specific player.- Parameters:
id- The player's id.numScores- The number of scores to return.- Returns:
LiveDataof aListof high-scoring attempts by the specified player.
-
-