RoomDatabase.Callback


public abstract class RoomDatabase.Callback


Callback for RoomDatabase

Summary

Public constructors

Public methods

void

Called when the database is created for the first time.

void

Called after the database was destructively migrated.

void

Called when the database has been opened.

Public constructors

Callback

Added in 2.0.0
public Callback()

Callback

Added in 2.0.0
public Callback()

Public methods

onCreate

Added in 2.7.0-alpha01
public void onCreate(@NonNull SQLiteConnection connection)

Called when the database is created for the first time.

This function called after all the tables are created.

Parameters
@NonNull SQLiteConnection connection

The database connection.

onDestructiveMigration

Added in 2.7.0-alpha01
public void onDestructiveMigration(@NonNull SQLiteConnection connection)

Called after the database was destructively migrated.

Parameters
@NonNull SQLiteConnection connection

The database connection.

onOpen

Added in 2.7.0-alpha01
public void onOpen(@NonNull SQLiteConnection connection)

Called when the database has been opened.

Parameters
@NonNull SQLiteConnection connection

The database connection.