mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Add: Room tables (1/5 in replacing SQLite with Room)
This commit is contained in:
parent
88fce8d15d
commit
da5b6108c8
67
src/main/kotlin/com/looker/droidify/database/Tables.kt
Normal file
67
src/main/kotlin/com/looker/droidify/database/Tables.kt
Normal file
@ -0,0 +1,67 @@
|
||||
package com.looker.droidify.database
|
||||
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import com.looker.droidify.entity.Product
|
||||
import com.looker.droidify.entity.ProductItem
|
||||
import com.looker.droidify.entity.Repository
|
||||
|
||||
@Entity
|
||||
class Repository {
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@ColumnInfo(name = "_id")
|
||||
var id: Long = 0
|
||||
|
||||
var enabled = 0
|
||||
var deleted = 0
|
||||
|
||||
@ColumnInfo(typeAffinity = ColumnInfo.BLOB)
|
||||
var data: Repository? = null
|
||||
}
|
||||
|
||||
@Entity(primaryKeys = ["repository_id", "package_name"])
|
||||
class Product {
|
||||
var repository_id: Long = 0
|
||||
var package_name = ""
|
||||
|
||||
var name = ""
|
||||
var summary = ""
|
||||
var description = ""
|
||||
var added = 0
|
||||
var updated = 0
|
||||
var version_code = 0
|
||||
var signatures = ""
|
||||
var compatible = 0
|
||||
|
||||
@ColumnInfo(typeAffinity = ColumnInfo.BLOB)
|
||||
var data: Product? = null
|
||||
|
||||
@ColumnInfo(typeAffinity = ColumnInfo.BLOB)
|
||||
var data_item: ProductItem? = null
|
||||
}
|
||||
|
||||
@Entity(primaryKeys = ["repository_id", "package_name", "name"])
|
||||
class Category {
|
||||
var repository_id: Long = 0
|
||||
var package_name = ""
|
||||
var name = ""
|
||||
}
|
||||
|
||||
@Entity
|
||||
class Installed {
|
||||
@PrimaryKey
|
||||
var package_name = ""
|
||||
|
||||
var version = ""
|
||||
var version_code = 0
|
||||
var signatures = ""
|
||||
}
|
||||
|
||||
@Entity
|
||||
class Lock {
|
||||
@PrimaryKey
|
||||
var package_name = ""
|
||||
|
||||
var version_code = 0
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user