package com.ustadmobile.libcache.db.dao

import androidx.room.EntityInsertAdapter
import androidx.room.RoomDatabase
import androidx.room.util.performSuspending
import androidx.sqlite.SQLiteStatement
import com.ustadmobile.libcache.db.entities.PinnedPublication
import javax.`annotation`.processing.Generated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.reflect.KClass

@Generated(value = ["androidx.room.RoomProcessor"])
@Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
public class PinnedPublicationDao_Impl(
  __db: RoomDatabase,
) : PinnedPublicationDao() {
  private val __db: RoomDatabase

  private val __insertAdapterOfPinnedPublication: EntityInsertAdapter<PinnedPublication>
  init {
    this.__db = __db
    this.__insertAdapterOfPinnedPublication = object : EntityInsertAdapter<PinnedPublication>() {
      protected override fun createQuery(): String = "INSERT OR REPLACE INTO `PinnedPublication` (`ppUrlHash`,`title`) VALUES (?,?)"

      protected override fun bind(statement: SQLiteStatement, entity: PinnedPublication) {
        statement.bindLong(1, entity.ppUrlHash)
        statement.bindText(2, entity.title)
      }
    }
  }

  public override suspend fun insert(publication: PinnedPublication): Unit = performSuspending(__db, false, true) { _connection ->
    __insertAdapterOfPinnedPublication.insert(_connection, publication)
  }

  public companion object {
    public fun getRequiredConverters(): List<KClass<*>> = emptyList()
  }
}
