add delete querys for conferences, events and recordings

This commit is contained in:
Felix 2018-01-03 01:12:23 +01:00
parent d9b70abfac
commit acf73efa2f
3 changed files with 9 additions and 4 deletions

View file

@ -1,10 +1,7 @@
package de.nicidienase.chaosflix.common.entities.recording.persistence
import android.arch.lifecycle.LiveData
import android.arch.persistence.room.Dao
import android.arch.persistence.room.Insert
import android.arch.persistence.room.OnConflictStrategy
import android.arch.persistence.room.Query
import android.arch.persistence.room.*
@Dao
interface ConferenceDao{
@ -22,4 +19,7 @@ interface ConferenceDao{
@Query("SELECT * FROM conference WHERE conferenceGroupId = :id ORDER BY acronym DESC")
fun findConferenceByGroup(id: Long): LiveData<List<PersistentConference>>
@Delete
fun deleteConference(vararg conference: PersistentConference)
}

View file

@ -37,4 +37,6 @@ interface EventDao{
@Query("SELECT * FROM event WHERE frontendLink = :url ")
fun findEventsByFrontendurl(url: String):LiveData<PersistentEvent>
@Query("DELETE FROM event WHERE conferenceId = :conferenceId")
fun deleteEventsForConference(conferenceId: Long)
}

View file

@ -19,4 +19,7 @@ interface RecordingDao{
@Query("SELECT * FROM recording WHERE eventId = :id")
fun findRecordingByEvent(id: Long): LiveData<List<PersistentRecording>>
@Query("DELETE FROM recording WHERE eventId = :eventId")
fun deleteRecordingsForEvent(eventId: Long)
}