package com.all.pdfreader.pro.app.room.database

import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import com.all.pdfreader.pro.app.room.converter.DateConverter
import com.all.pdfreader.pro.app.room.converter.UriConverter
import com.all.pdfreader.pro.app.room.dao.*
import com.all.pdfreader.pro.app.room.entity.*

@Database(
    entities = [
        PdfDocumentEntity::class,
        RecentReadEntity::class,
        BookmarkEntity::class,
        NoteEntity::class
    ],
    version = 1,
    exportSchema = false
)
@TypeConverters(DateConverter::class, UriConverter::class)
abstract class PdfDatabase : RoomDatabase() {
    
    abstract fun pdfDocumentDao(): PdfDocumentDao
    abstract fun recentReadDao(): RecentReadDao
    abstract fun bookmarkDao(): BookmarkDao
    abstract fun noteDao(): NoteDao
    
    companion object {
        const val DATABASE_NAME = "pdf_database"
    }
}