Interface ChallengeAttemptDao
-
public interface ChallengeAttemptDao
Provides an interface with methods that perform actions on theChallengeAttempt
table 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
Single
holding 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
Single
holding aList
of 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
Single
holding aList
of 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
Single
holding 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
Single
holding 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
Single
holding 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
Single
holding 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
Single
holding 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
Single
holding 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:
LiveData
of the selected attempt.
-
selectAll
LiveData<List<ChallengeAttempt>> selectAll()
Queries the database for all attempts. Orders by most recent first.- Returns:
LiveData
of aList
of 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:
LiveData
of aList
of 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:
LiveData
of aList
of 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:
LiveData
of aList
of high-scoring attempts by the specified player.
-
-