mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
preparing the migration to Room database
This commit is contained in:
@ -1,9 +1,20 @@
|
||||
package com.simplemobiletools.notes.pro.models
|
||||
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Index
|
||||
import androidx.room.PrimaryKey
|
||||
import java.io.File
|
||||
import java.io.FileNotFoundException
|
||||
|
||||
data class Note(var id: Int, var title: String, var value: String, val type: Int, var path: String = "") {
|
||||
@Entity(tableName = "notes", indices = [(Index(value = ["id"], unique = true))])
|
||||
data class Note(
|
||||
@PrimaryKey(autoGenerate = true) var id: Int?,
|
||||
@ColumnInfo(name = "title") var title: String,
|
||||
@ColumnInfo(name = "value") var value: String,
|
||||
@ColumnInfo(name = "type") var type: Int,
|
||||
@ColumnInfo(name = "path") var path: String = "") {
|
||||
|
||||
fun getNoteStoredValue(): String? {
|
||||
return if (path.isNotEmpty()) {
|
||||
return try {
|
||||
|
Reference in New Issue
Block a user