Interface ScaleDao
-
public interface ScaleDao
Provides an interface with methods that perform actions on theScale
table 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
Single
holding 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
Single
holdingList
of 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
Single
holdingList
of 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
Single
holding 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
Single
holding 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
Single
holding 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
Single
holding 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
Single
holding 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
Single
holding 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:
LiveData
of the selected scale.
-
selectAll
LiveData<List<Scale>> selectAll()
Queries the database for all scales.- Returns:
LiveData
of aList
of scales.
-
selectAllOrderByDifficulty
LiveData<List<Scale>> selectAllOrderByDifficulty()
Queries the database for all scales, ordering based on difficulty.- Returns:
LiveData
of aList
of 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:
LiveData
of 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:
LiveData
of aList
of scales.
-
-