mirror of
https://github.com/hmalik144/LiveTemplatesDictionary.git
synced 2025-12-10 03:05:28 +00:00
Update roomdatabase
This commit is contained in:
@@ -8,14 +8,14 @@
|
|||||||
entities = [EntityItem::class],
|
entities = [EntityItem::class],
|
||||||
version = 1
|
version = 1
|
||||||
)
|
)
|
||||||
abstract class $DATABASENAME$Database : androidx.room.RoomDatabase() {
|
abstract class $DATABASENAME$ : androidx.room.RoomDatabase() {
|
||||||
|
|
||||||
abstract fun getSimpleDao(): SimpleDao
|
abstract fun getSimpleDao(): SimpleDao
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
@Volatile
|
@Volatile
|
||||||
private var instance: $DATABASENAME$Database? = null
|
private var instance: $DATABASENAME$? = null
|
||||||
private val LOCK = Any()
|
private val LOCK = Any()
|
||||||
|
|
||||||
// create an instance of room database or use previously created instance
|
// create an instance of room database or use previously created instance
|
||||||
@@ -28,7 +28,7 @@ abstract class $DATABASENAME$Database : androidx.room.RoomDatabase() {
|
|||||||
private fun buildDatabase(context: android.content.Context) =
|
private fun buildDatabase(context: android.content.Context) =
|
||||||
androidx.room.Room.databaseBuilder(
|
androidx.room.Room.databaseBuilder(
|
||||||
context.applicationContext,
|
context.applicationContext,
|
||||||
$DATABASENAME$Database::class.java,
|
$DATABASENAME$::class.java,
|
||||||
"MyDatabase.db"
|
"MyDatabase.db"
|
||||||
).build()
|
).build()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user