mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Project Initiated by creating helper classes for database operations
This commit is contained in:
parent
05641b0c3d
commit
1be640f6b8
2 changed files with 40 additions and 0 deletions
|
|
@ -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)
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
|
)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue