get Notes Count

@Query(value = "SELECT COUNT(*) FROM " + NOTES_KEY + " WHERE " + AUTHOR_KEY + "=:" + AUTHOR_KEY + " AND " + UPDATE_KEY + " IS NULL", nativeQuery = true )
abstract fun getNotesCount(@Param(value = "author") authorId: String): Long

Method to execute the query to select the number of the notes

Return

the number of the notes

Parameters

authorId

The author identifier


@Query(value = "SELECT COUNT(*) FROM " + NOTES_KEY + " WHERE " + AUTHOR_KEY + "=:" + AUTHOR_KEY + " AND " + MARKED_AS_DONE_KEY + "=:" + MARKED_AS_DONE_KEY + " AND " + UPDATE_KEY + " IS NULL", nativeQuery = true )
abstract fun getNotesCount(@Param(value = "author") authorId: String, @Param(value = "marked_as_done") markedAsDone: Boolean): Long

Method to execute the query to select the number of the notes

Return

the number of the notes

Parameters

authorId

The author identifier

markedAsDone

Whether retrieve the notes marked as done or the not ones