1 import androidx.room.InvalidationTracker 2 import androidx.room.RoomOpenDelegate 3 import androidx.room.migration.AutoMigrationSpec 4 import androidx.room.migration.Migration 5 import androidx.room.util.FtsTableInfo 6 import androidx.room.util.TableInfo 7 import androidx.room.util.ViewInfo 8 import androidx.room.util.dropFtsSyncTriggers 9 import androidx.sqlite.SQLiteConnection 10 import androidx.sqlite.execSQL 11 import javax.`annotation`.processing.Generated 12 import kotlin.Lazy 13 import kotlin.String 14 import kotlin.Suppress 15 import kotlin.collections.List 16 import kotlin.collections.Map 17 import kotlin.collections.MutableList 18 import kotlin.collections.MutableMap 19 import kotlin.collections.MutableSet 20 import kotlin.collections.Set 21 import kotlin.collections.mutableListOf 22 import kotlin.collections.mutableMapOf 23 import kotlin.collections.mutableSetOf 24 import kotlin.reflect.KClass 25 import androidx.room.util.FtsTableInfo.Companion.read as ftsTableInfoRead 26 import androidx.room.util.TableInfo.Companion.read as tableInfoRead 27 import androidx.room.util.ViewInfo.Companion.read as viewInfoRead 28 29 @Generated(value = ["androidx.room.RoomProcessor"]) 30 @Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"]) 31 public class MyDatabase_Impl : MyDatabase() { <lambda>null32 private val _myDao: Lazy<MyDao> = lazy { 33 MyDao_Impl(this) 34 } 35 createOpenDelegatenull36 protected override fun createOpenDelegate(): RoomOpenDelegate { 37 val _openDelegate: RoomOpenDelegate = object : RoomOpenDelegate(1, "89ba16fb8b062b50acf0eb06c853efcb", "8a71a68e07bdd62aa8c8324d870cf804") { 38 public override fun createAllTables(connection: SQLiteConnection) { 39 connection.execSQL("CREATE TABLE IF NOT EXISTS `MyParentEntity` (`parentKey` INTEGER NOT NULL, PRIMARY KEY(`parentKey`))") 40 connection.execSQL("CREATE TABLE IF NOT EXISTS `MyEntity` (`pk` INTEGER NOT NULL, `indexedCol` TEXT NOT NULL, PRIMARY KEY(`pk`), FOREIGN KEY(`indexedCol`) REFERENCES `MyParentEntity`(`parentKey`) ON UPDATE NO ACTION ON DELETE CASCADE )") 41 connection.execSQL("CREATE INDEX IF NOT EXISTS `index_MyEntity_indexedCol` ON `MyEntity` (`indexedCol`)") 42 connection.execSQL("CREATE VIRTUAL TABLE IF NOT EXISTS `MyFtsEntity` USING FTS4(`text` TEXT NOT NULL)") 43 connection.execSQL("CREATE VIEW `MyView` AS SELECT text FROM MyFtsEntity") 44 connection.execSQL("CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)") 45 connection.execSQL("INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '89ba16fb8b062b50acf0eb06c853efcb')") 46 } 47 48 public override fun dropAllTables(connection: SQLiteConnection) { 49 connection.execSQL("DROP TABLE IF EXISTS `MyParentEntity`") 50 connection.execSQL("DROP TABLE IF EXISTS `MyEntity`") 51 connection.execSQL("DROP TABLE IF EXISTS `MyFtsEntity`") 52 connection.execSQL("DROP VIEW IF EXISTS `MyView`") 53 } 54 55 public override fun onCreate(connection: SQLiteConnection) { 56 } 57 58 public override fun onOpen(connection: SQLiteConnection) { 59 connection.execSQL("PRAGMA foreign_keys = ON") 60 internalInitInvalidationTracker(connection) 61 } 62 63 public override fun onPreMigrate(connection: SQLiteConnection) { 64 dropFtsSyncTriggers(connection) 65 } 66 67 public override fun onPostMigrate(connection: SQLiteConnection) { 68 } 69 70 public override fun onValidateSchema(connection: SQLiteConnection): RoomOpenDelegate.ValidationResult { 71 val _columnsMyParentEntity: MutableMap<String, TableInfo.Column> = mutableMapOf() 72 _columnsMyParentEntity.put("parentKey", TableInfo.Column("parentKey", "INTEGER", true, 1, null, TableInfo.CREATED_FROM_ENTITY)) 73 val _foreignKeysMyParentEntity: MutableSet<TableInfo.ForeignKey> = mutableSetOf() 74 val _indicesMyParentEntity: MutableSet<TableInfo.Index> = mutableSetOf() 75 val _infoMyParentEntity: TableInfo = TableInfo("MyParentEntity", _columnsMyParentEntity, _foreignKeysMyParentEntity, _indicesMyParentEntity) 76 val _existingMyParentEntity: TableInfo = tableInfoRead(connection, "MyParentEntity") 77 if (!_infoMyParentEntity.equals(_existingMyParentEntity)) { 78 return RoomOpenDelegate.ValidationResult(false, """ 79 |MyParentEntity(MyParentEntity). 80 | Expected: 81 |""".trimMargin() + _infoMyParentEntity + """ 82 | 83 | Found: 84 |""".trimMargin() + _existingMyParentEntity) 85 } 86 val _columnsMyEntity: MutableMap<String, TableInfo.Column> = mutableMapOf() 87 _columnsMyEntity.put("pk", TableInfo.Column("pk", "INTEGER", true, 1, null, TableInfo.CREATED_FROM_ENTITY)) 88 _columnsMyEntity.put("indexedCol", TableInfo.Column("indexedCol", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY)) 89 val _foreignKeysMyEntity: MutableSet<TableInfo.ForeignKey> = mutableSetOf() 90 _foreignKeysMyEntity.add(TableInfo.ForeignKey("MyParentEntity", "CASCADE", "NO ACTION", listOf("indexedCol"), listOf("parentKey"))) 91 val _indicesMyEntity: MutableSet<TableInfo.Index> = mutableSetOf() 92 _indicesMyEntity.add(TableInfo.Index("index_MyEntity_indexedCol", false, listOf("indexedCol"), listOf("ASC"))) 93 val _infoMyEntity: TableInfo = TableInfo("MyEntity", _columnsMyEntity, _foreignKeysMyEntity, _indicesMyEntity) 94 val _existingMyEntity: TableInfo = tableInfoRead(connection, "MyEntity") 95 if (!_infoMyEntity.equals(_existingMyEntity)) { 96 return RoomOpenDelegate.ValidationResult(false, """ 97 |MyEntity(MyEntity). 98 | Expected: 99 |""".trimMargin() + _infoMyEntity + """ 100 | 101 | Found: 102 |""".trimMargin() + _existingMyEntity) 103 } 104 val _columnsMyFtsEntity: MutableSet<String> = mutableSetOf() 105 _columnsMyFtsEntity.add("text") 106 val _infoMyFtsEntity: FtsTableInfo = FtsTableInfo("MyFtsEntity", _columnsMyFtsEntity, "CREATE VIRTUAL TABLE IF NOT EXISTS `MyFtsEntity` USING FTS4(`text` TEXT NOT NULL)") 107 val _existingMyFtsEntity: FtsTableInfo = ftsTableInfoRead(connection, "MyFtsEntity") 108 if (!_infoMyFtsEntity.equals(_existingMyFtsEntity)) { 109 return RoomOpenDelegate.ValidationResult(false, """ 110 |MyFtsEntity(MyFtsEntity). 111 | Expected: 112 |""".trimMargin() + _infoMyFtsEntity + """ 113 | 114 | Found: 115 |""".trimMargin() + _existingMyFtsEntity) 116 } 117 val _infoMyView: ViewInfo = ViewInfo("MyView", "CREATE VIEW `MyView` AS SELECT text FROM MyFtsEntity") 118 val _existingMyView: ViewInfo = viewInfoRead(connection, "MyView") 119 if (!_infoMyView.equals(_existingMyView)) { 120 return RoomOpenDelegate.ValidationResult(false, """ 121 |MyView(MyView). 122 | Expected: 123 |""".trimMargin() + _infoMyView + """ 124 | 125 | Found: 126 |""".trimMargin() + _existingMyView) 127 } 128 return RoomOpenDelegate.ValidationResult(true, null) 129 } 130 } 131 return _openDelegate 132 } 133 createInvalidationTrackernull134 protected override fun createInvalidationTracker(): InvalidationTracker { 135 val _shadowTablesMap: MutableMap<String, String> = mutableMapOf() 136 _shadowTablesMap.put("MyFtsEntity", "MyFtsEntity_content") 137 val _viewTables: MutableMap<String, Set<String>> = mutableMapOf() 138 val _tables: MutableSet<String> = mutableSetOf() 139 _tables.add("MyFtsEntity") 140 _viewTables.put("myview", _tables) 141 return InvalidationTracker(this, _shadowTablesMap, _viewTables, "MyParentEntity", "MyEntity", "MyFtsEntity") 142 } 143 clearAllTablesnull144 public override fun clearAllTables() { 145 super.performClear(true, "MyParentEntity", "MyEntity", "MyFtsEntity") 146 } 147 getRequiredTypeConverterClassesnull148 protected override fun getRequiredTypeConverterClasses(): Map<KClass<*>, List<KClass<*>>> { 149 val _typeConvertersMap: MutableMap<KClass<*>, List<KClass<*>>> = mutableMapOf() 150 _typeConvertersMap.put(MyDao::class, MyDao_Impl.getRequiredConverters()) 151 return _typeConvertersMap 152 } 153 getRequiredAutoMigrationSpecClassesnull154 public override fun getRequiredAutoMigrationSpecClasses(): Set<KClass<out AutoMigrationSpec>> { 155 val _autoMigrationSpecsSet: MutableSet<KClass<out AutoMigrationSpec>> = mutableSetOf() 156 return _autoMigrationSpecsSet 157 } 158 createAutoMigrationsnull159 public override fun createAutoMigrations(autoMigrationSpecs: Map<KClass<out AutoMigrationSpec>, AutoMigrationSpec>): List<Migration> { 160 val _autoMigrations: MutableList<Migration> = mutableListOf() 161 return _autoMigrations 162 } 163 getDaonull164 public override fun getDao(): MyDao = _myDao.value 165 } 166