Interface ScaleChallengeAttemptDao


  • public interface ScaleChallengeAttemptDao
    Provides an interface with methods that perform actions on the ScaleChallengeAttempt table of 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 single ScaleChallengeAttempt 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 a List 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 a List 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.
      • 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 a List of ChallengeAttempt.
      • 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 a List of ChallengeAttempt.
      • 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 a List of Scale.
      • selectScalesOrderByDate

        LiveData<List<Scale>> selectScalesOrderByDate​(long attemptId)
        Queries the database for scales based on a challenge attempt id, ordering by timestamp.
        Parameters:
        attemptId - The id of the ChallengeAttempt
        Returns:
        LiveData of a List of Scale.