Interface ScaleDao
-
public interface ScaleDaoProvides an interface with methods that perform actions on theScaletable of the database.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Single<Integer>delete(Scale scale)Deletes a single scale from the database.Single<Integer>delete(Scale... scales)Deletes multiple scales from the database.Single<Integer>delete(Collection<Scale> scales)Deletes multiple scales from the database.Single<Long>insert(Scale scale)Inserts a single scale into the database.Single<List<Long>>insert(Scale... scales)Inserts multiple scales into the database.Single<List<Long>>insert(Collection<Scale> scales)Inserts multiple scales into the database.LiveData<Scale>select(long id)Queries the database for a specific scale, based on id.LiveData<List<Scale>>selectAll()Queries the database for all scales.LiveData<List<Scale>>selectAllOrderByDifficulty()Queries the database for all scales, ordering based on difficulty.LiveData<List<Scale>>selectWithMode(Mode mode)Queries the database for specific scales, based on mode.LiveData<Scale>selectWithScaleName(Mode mode, Note tonic)Queries the database for a specific scale, based on tonic and mode.LiveData<List<Scale>>selectWithTonic(Note tonic)Queries the database for specific scales, based on tonic.Single<Integer>update(Scale scale)Updates a single scale in the database.Single<Integer>update(Scale... scales)Updates multiple scales in the database.Single<Integer>update(Collection<Scale> scales)Updates multiple scales in the database.
-
-
-
Method Detail
-
insert
Single<Long> insert(Scale scale)
Inserts a single scale into the database.- Parameters:
scale- The scale to be inserted.- Returns:
- A
Singleholding the id of the scale that was inserted.
-
insert
Single<List<Long>> insert(Scale... scales)
Inserts multiple scales into the database.- Parameters:
scales- The scales to be inserted.- Returns:
- A
SingleholdingListof ids of scales that were inserted.
-
insert
Single<List<Long>> insert(Collection<Scale> scales)
Inserts multiple scales into the database.- Parameters:
scales- The scales to be inserted.- Returns:
- A
SingleholdingListof ids of scales that were inserted.
-
update
Single<Integer> update(Scale scale)
Updates a single scale in the database.- Parameters:
scale- The scale to be updated.- Returns:
- A
Singleholding the number of updates performed.
-
update
Single<Integer> update(Scale... scales)
Updates multiple scales in the database.- Parameters:
scales- The scales to be updated.- Returns:
- A
Singleholding the number of updates performed.
-
update
Single<Integer> update(Collection<Scale> scales)
Updates multiple scales in the database.- Parameters:
scales- The scales to be updated.- Returns:
- A
Singleholding the number of updates performed.
-
delete
Single<Integer> delete(Scale scale)
Deletes a single scale from the database.- Parameters:
scale- The scale to be deleted.- Returns:
- A
Singleholding the number of deletions performed.
-
delete
Single<Integer> delete(Scale... scales)
Deletes multiple scales from the database.- Parameters:
scales- The scales to be deleted.- Returns:
- A
Singleholding the number of deletions performed.
-
delete
Single<Integer> delete(Collection<Scale> scales)
Deletes multiple scales from the database.- Parameters:
scales- The scales to be deleted.- Returns:
- A
Singleholding the number of deletions performed.
-
select
LiveData<Scale> select(long id)
Queries the database for a specific scale, based on id.- Parameters:
id- The scale's id.- Returns:
LiveDataof the selected scale.
-
selectAll
LiveData<List<Scale>> selectAll()
Queries the database for all scales.- Returns:
LiveDataof aListof scales.
-
selectAllOrderByDifficulty
LiveData<List<Scale>> selectAllOrderByDifficulty()
Queries the database for all scales, ordering based on difficulty.- Returns:
LiveDataof aListof scales.
-
selectWithScaleName
LiveData<Scale> selectWithScaleName(Mode mode, Note tonic)
Queries the database for a specific scale, based on tonic and mode.- Parameters:
mode- The scale's mode.tonic- The scale's tonic.- Returns:
LiveDataof the selected scale.
-
selectWithTonic
LiveData<List<Scale>> selectWithTonic(Note tonic)
Queries the database for specific scales, based on tonic.- Parameters:
tonic- The tonic of the scales.- Returns:
LiveDataof aListof scales.
-
-