added in version 1.1.0
belongs to Maven artifact android.arch.persistence.room:runtime:1.1.0-beta2

DatabaseConfiguration

public class DatabaseConfiguration
extends Object

java.lang.Object
   ↳ android.arch.persistence.room.DatabaseConfiguration


Configuration class for a RoomDatabase.

Summary

Fields

public final boolean allowMainThreadQueries

Whether Room should throw an exception for queries run on the main thread.

public final List<RoomDatabase.Callback> callbacks

public final Context context

The context to use while connecting to the database.

public final RoomDatabase.JournalMode journalMode

The journal mode for this database.

public final RoomDatabase.MigrationContainer migrationContainer

Collection of available migrations.

public final String name

The name of the database file or null if it is an in-memory database.

public final boolean requireMigration

If true, Room should crash if a migration is missing.

public final SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory

The factory to use to access the database.

Public methods

boolean isMigrationRequiredFrom(int version)

Returns whether a migration is required from the specified version.

Inherited methods

Fields

allowMainThreadQueries

added in version 1.1.0
boolean allowMainThreadQueries

Whether Room should throw an exception for queries run on the main thread.

callbacks

added in version 1.1.0
List<RoomDatabase.Callback> callbacks

context

added in version 1.1.0
Context context

The context to use while connecting to the database.

journalMode

added in version 1.1.0
RoomDatabase.JournalMode journalMode

The journal mode for this database.

migrationContainer

added in version 1.1.0
RoomDatabase.MigrationContainer migrationContainer

Collection of available migrations.

name

added in version 1.1.0
String name

The name of the database file or null if it is an in-memory database.

requireMigration

added in version 1.1.0
boolean requireMigration

If true, Room should crash if a migration is missing.

sqliteOpenHelperFactory

added in version 1.1.0
SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory

The factory to use to access the database.

Public methods

isMigrationRequiredFrom

added in version 1.1.0
boolean isMigrationRequiredFrom (int version)

Returns whether a migration is required from the specified version.

Parameters
version int: The schema version.

Returns
boolean True if a valid migration is required, false otherwise.