app / sg.edu.ntu.scse.cz2006.gymbuddies.data / GBDatabase

GBDatabase

abstract class GBDatabase : RoomDatabase

Room database for Gym Buddy app it uses singleton design pattern, it will only create one instance at all time schema information will be exported to '../app/schemas/' whenever database version update

Author
Chia Yu

Since
2019-09-14

Constructors

<init>

Room database for Gym Buddy app it uses singleton design pattern, it will only create one instance at all time schema information will be exported to '../app/schemas/' whenever database version update

GBDatabase()

Properties

FILE_DB_NAME

path to asset of pre-populated data

static var FILE_DB_NAME: String!

instance

singleton instance for database

static var instance: GBDatabase!

Functions

carParkDao

abstract getter for Data accessing object

abstract fun carParkDao(): CarParkDao!

getInstance

Getter method for Gym Buddy database if the room database is not existed, it creates from database file in assets folder

open static fun getInstance(context: Context!): GBDatabase!