package com.all.pdfreader.pdf.reader.room.database

import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import com.all.pdfreader.pdf.reader.room.converter.DateConverter
import com.all.pdfreader.pdf.reader.room.converter.UriConverter
import com.all.pdfreader.pdf.reader.room.dao.*
import com.all.pdfreader.pdf.reader.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"
    }
}