Class ScaleScrollerDatabase
- java.lang.Object
-
- androidx.room.RoomDatabase
-
- edu.cnm.deepdive.scalescroller.service.ScaleScrollerDatabase
-
public abstract class ScaleScrollerDatabase extends RoomDatabase
The ScaleScroller Database provides abstract methods that return the DAOs for each entity. It also provides methods to set the context and to return an instance of itself. It contains two public nested classes: Callback and Converters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ScaleScrollerDatabase.Callback
Overrides onCreate to populate the database with scales.static class
ScaleScrollerDatabase.Converters
Provides type converters to translate Java objects into data that can be stored in the SQLite database.-
Nested classes/interfaces inherited from class androidx.room.RoomDatabase
RoomDatabase.Builder<T extends RoomDatabase>, RoomDatabase.JournalMode, RoomDatabase.MigrationContainer
-
-
Field Summary
-
Fields inherited from class androidx.room.RoomDatabase
MAX_BIND_PARAMETER_CNT, mCallbacks, mDatabase
-
-
Constructor Summary
Constructors Constructor Description ScaleScrollerDatabase()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ChallengeAttemptDao
getChallengeAttemptDao()
Returns the ChallengeAttemptDao.static ScaleScrollerDatabase
getInstance()
Returns an instance of the singleton database.abstract LearnLevelAttemptDao
getLearnLevelAttemptDao()
Returns the LearnLevelAttemptDao.abstract PlayerDao
getPlayerDao()
Returns the PlayerDao.abstract ScaleChallengeAttemptDao
getScaleChallengeAttemptDao()
Returns the ScaleChallengeAttemptDao.abstract ScaleDao
getScaleDao()
Returns the ScaleDao.static void
setContext(Application context)
Sets the application context.-
Methods inherited from class androidx.room.RoomDatabase
assertNotMainThread, assertNotSuspendingTransaction, beginTransaction, clearAllTables, close, compileStatement, createInvalidationTracker, createOpenHelper, endTransaction, getInvalidationTracker, getOpenHelper, getQueryExecutor, getTransactionExecutor, init, internalInitInvalidationTracker, inTransaction, isOpen, query, query, query, runInTransaction, runInTransaction, setTransactionSuccessful
-
-
-
-
Method Detail
-
setContext
public static void setContext(Application context)
Sets the application context.- Parameters:
context
- The application context.
-
getInstance
public static ScaleScrollerDatabase getInstance()
Returns an instance of the singleton database.- Returns:
- An instance of
ScaleScrollerDatabase
-
getPlayerDao
public abstract PlayerDao getPlayerDao()
Returns the PlayerDao.- Returns:
- The PlayerDao.
-
getLearnLevelAttemptDao
public abstract LearnLevelAttemptDao getLearnLevelAttemptDao()
Returns the LearnLevelAttemptDao.- Returns:
- The LearnLevelAttemptDao.
-
getChallengeAttemptDao
public abstract ChallengeAttemptDao getChallengeAttemptDao()
Returns the ChallengeAttemptDao.- Returns:
- The ChallengeAttemptDao.
-
getScaleDao
public abstract ScaleDao getScaleDao()
Returns the ScaleDao.- Returns:
- The ScaleDao.
-
getScaleChallengeAttemptDao
public abstract ScaleChallengeAttemptDao getScaleChallengeAttemptDao()
Returns the ScaleChallengeAttemptDao.- Returns:
- The ScaleChallengeAttemptDao.
-
-