Class CardCombatDatabase
- java.lang.Object
-
- androidx.room.RoomDatabase
-
- edu.cnm.deepdive.cardcombat.service.CardCombatDatabase
-
public abstract class CardCombatDatabase extends RoomDatabase
The CardCombat 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 a public nested class: Converters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CardCombatDatabase.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.Callback, RoomDatabase.JournalMode, RoomDatabase.MigrationContainer
-
-
Field Summary
-
Fields inherited from class androidx.room.RoomDatabase
MAX_BIND_PARAMETER_CNT, mCallbacks, mDatabase
-
-
Constructor Summary
Constructors Constructor Description CardCombatDatabase()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract AttackCardDao
getAttackCardDao()
Returns the AttackCardDao.abstract DeckDao
getDeckDao()
Returns the DeckDao.abstract GameDao
getGameDao()
Returns the GameDao.static CardCombatDatabase
getInstance()
Returns an instance of the singleton database.abstract UnitCardDao
getUnitCardDao()
Returns the UnitCardDao.abstract UserDao
getUserDao()
Returns the UserDao.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 CardCombatDatabase getInstance()
Returns an instance of the singleton database.- Returns:
- An instance of
ScaleScrollerDatabase
-
getAttackCardDao
public abstract AttackCardDao getAttackCardDao()
Returns the AttackCardDao.- Returns:
- The AttackCardDao.
-
getDeckDao
public abstract DeckDao getDeckDao()
Returns the DeckDao.- Returns:
- The DeckDao.
-
getGameDao
public abstract GameDao getGameDao()
Returns the GameDao.- Returns:
- The GameDao.
-
getUnitCardDao
public abstract UnitCardDao getUnitCardDao()
Returns the UnitCardDao.- Returns:
- The UnitCardDao.
-
getUserDao
public abstract UserDao getUserDao()
Returns the UserDao.- Returns:
- The UserDao.
-
-