Skip to content

Instantly share code, notes, and snippets.

@PauloLinhares09
Created September 14, 2018 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PauloLinhares09/a2af348d1be3478882f0c836174c1f6e to your computer and use it in GitHub Desktop.
Save PauloLinhares09/a2af348d1be3478882f0c836174c1f6e to your computer and use it in GitHub Desktop.
@Dao
interface TeamDao{
@Query("SELECT * FROM Team ORDER BY id ASC")
fun getAllTeams() : List<Team>
@Query("SELECT * FROM Team WHERE Team.id = :myId")
fun getTeam(myId: Long) : Team
@Insert
fun insertTeam(team: Team) : Long
@Insert(onConflict = IGNORE)
fun insertOrReplaceTeams(vararg team: Team)
@Delete
fun deleteTeam(team: Team)
@Query("DELETE FROM Team")
fun deleteAllTeams()
@Update
fun updateTeam(team: Team)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment