Interface ScaleChallengeAttemptDao
-
public interface ScaleChallengeAttemptDao
Provides an interface with methods that perform actions on theScaleChallengeAttempt
table of the database.
-
-
Field Summary
Fields Modifier and Type Field Description static String
SELECT_CHALLENGE_ATTEMPTS_ORDER_BY_DATE_QUERY
A query which selects challenge attempts for a single scale id, ordering by timestamp from most recent to less recent.static String
SELECT_CHALLENGE_ATTEMPTS_ORDER_BY_SCORE_QUERY
A query which selects challenge attempts for a single scale id, ordering by score from highest to lowest.static String
SELECT_SCALES_BY_DATE_QUERY
A query which selects scales for a single challenge attempt id, ordering by timestamp.static String
SELECT_SCALES_BY_NAME_QUERY
A query which selects scales for a single challenge attempt id, ordering by scale name.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Single<Integer>
delete(ScaleChallengeAttempt attempt)
Deletes a single attempt from the database.Single<Integer>
delete(ScaleChallengeAttempt... attempts)
Deletes multiple attempts from the database.Single<Integer>
delete(Collection<ScaleChallengeAttempt> attempts)
Deletes multiple attempts from the database.Single<Long>
insert(ScaleChallengeAttempt attempt)
Inserts a singleScaleChallengeAttempt
into the database.Single<List<Long>>
insert(ScaleChallengeAttempt... attempts)
Inserts multiple attempts into the database.Single<List<Long>>
insert(Collection<ScaleChallengeAttempt> attempts)
Inserts multiple attempts into the database.LiveData<ScaleChallengeAttempt>
select(long id)
Queries the database for a single attempt, based on id.LiveData<List<ScaleChallengeAttempt>>
selectAll()
Queries the database for all attempts.LiveData<List<ChallengeAttempt>>
selectChallengeAttemptsOrderByDate(long scaleId)
Queries the database for challenge attempts based on a scale id, ordering by timestamp from most recent to less recent.LiveData<List<ChallengeAttempt>>
selectChallengeAttemptsOrderByScore(long scaleId)
Queries the database for challenge attempts based on a scale id, ordering by score from highest to lowest.LiveData<List<Scale>>
selectScalesOrderByDate(long attemptId)
Queries the database for scales based on a challenge attempt id, ordering by timestamp.LiveData<List<Scale>>
selectScalesOrderByName(long attemptId)
Queries the database for scales based on a challenge attempt id, ordering by scale name.Single<Integer>
update(ScaleChallengeAttempt attempt)
Updates a single attempt in the database.Single<Integer>
update(ScaleChallengeAttempt... attempts)
Updates multiple attempts in the database.Single<Integer>
update(Collection<ScaleChallengeAttempt> attempts)
Updates multiple attempts in the database.
-
-
-
Field Detail
-
SELECT_CHALLENGE_ATTEMPTS_ORDER_BY_SCORE_QUERY
static final String SELECT_CHALLENGE_ATTEMPTS_ORDER_BY_SCORE_QUERY
A query which selects challenge attempts for a single scale id, ordering by score from highest to lowest.- See Also:
- Constant Field Values
-
SELECT_CHALLENGE_ATTEMPTS_ORDER_BY_DATE_QUERY
static final String SELECT_CHALLENGE_ATTEMPTS_ORDER_BY_DATE_QUERY
A query which selects challenge attempts for a single scale id, ordering by timestamp from most recent to less recent.- See Also:
- Constant Field Values
-
SELECT_SCALES_BY_NAME_QUERY
static final String SELECT_SCALES_BY_NAME_QUERY
A query which selects scales for a single challenge attempt id, ordering by scale name.- See Also:
- Constant Field Values
-
SELECT_SCALES_BY_DATE_QUERY
static final String SELECT_SCALES_BY_DATE_QUERY
A query which selects scales for a single challenge attempt id, ordering by timestamp.- See Also:
- Constant Field Values
-
-
Method Detail
-
insert
Single<Long> insert(ScaleChallengeAttempt attempt)
Inserts a singleScaleChallengeAttempt
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(ScaleChallengeAttempt... 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<ScaleChallengeAttempt> 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(ScaleChallengeAttempt 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(ScaleChallengeAttempt... 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<ScaleChallengeAttempt> 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(ScaleChallengeAttempt 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(ScaleChallengeAttempt... 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<ScaleChallengeAttempt> 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<ScaleChallengeAttempt> select(long id)
Queries the database for a single attempt, based on id.- Parameters:
id
- The id of the attempt.- Returns:
LiveData
of the selected attempt.
-
selectAll
LiveData<List<ScaleChallengeAttempt>> selectAll()
Queries the database for all attempts.- Returns:
LiveData
of aList
of attempts.
-
selectChallengeAttemptsOrderByScore
LiveData<List<ChallengeAttempt>> selectChallengeAttemptsOrderByScore(long scaleId)
Queries the database for challenge attempts based on a scale id, ordering by score from highest to lowest.- Parameters:
scaleId
- The id of the scale.- Returns:
LiveData
of aList
ofChallengeAttempt
.
-
selectChallengeAttemptsOrderByDate
LiveData<List<ChallengeAttempt>> selectChallengeAttemptsOrderByDate(long scaleId)
Queries the database for challenge attempts based on a scale id, ordering by timestamp from most recent to less recent.- Parameters:
scaleId
- The id of the scale.- Returns:
LiveData
of aList
ofChallengeAttempt
.
-
selectScalesOrderByName
LiveData<List<Scale>> selectScalesOrderByName(long attemptId)
Queries the database for scales based on a challenge attempt id, ordering by scale name.- Parameters:
attemptId
- The id of the ChallengeAttempt.- Returns:
LiveData
of aList
ofScale
.
-
-