Project Initiated by creating helper classes for database operations

This commit is contained in:
ayans 2022-06-13 09:49:10 +05:30
parent 05641b0c3d
commit 1be640f6b8
2 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,23 @@
package fr.free.nrw.commons.customselector.database
import androidx.room.*
/**
* Dao class for Not For Upload
*/
@Dao
abstract class NotForUploadDao {
/**
* Insert into Not For Upload status.
*/
@Insert( onConflict = OnConflictStrategy.REPLACE )
abstract suspend fun insert(notForUploadStatus: NotForUploadStatus)
/**
* Delete Not For Upload status entry.
*/
@Delete
abstract suspend fun delete(notForUploadStatus: NotForUploadStatus)
}

View file

@ -0,0 +1,17 @@
package fr.free.nrw.commons.customselector.database
import androidx.room.Entity
import androidx.room.PrimaryKey
/**
* Entity class for Not For Upload status.
*/
@Entity(tableName = "not_for_upload_table")
data class NotForUploadStatus(
/**
* Original image sha1.
*/
@PrimaryKey
val imageSHA1 : String
)