package com.za.room.db.user

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update


@Dao
interface LocalResourceDao {
	@Insert
	fun insert(localResourceBean : LocalResourceBean)

	@Update
	fun update(localResourceBean : LocalResourceBean)

	@Delete
	fun delete(localResourceBean : LocalResourceBean)

	@get:Query("SELECT * FROM local_resource_bean")
	val allLocalResources : List<LocalResourceBean?>?

	@Query("SELECT * FROM local_resource_bean WHERE resourceName = :resourceName")
	fun getLocalResourceByName(resourceName : String?) : LocalResourceBean?

	@Query("SELECT * FROM local_resource_bean WHERE resourceType = :resourceType")
	fun getLocalResourcesByType(resourceType : Int) : List<LocalResourceBean>?

	@Query("DELETE FROM local_resource_bean")
	fun deleteAllLocalResources()
}
