Interface TableDefinition<R extends Record>
A table to open with a schema version and migrations. It starts from the record's
Schema and Migrate methods, if any; the calls below add to them:
Table<Balance> balances = this.storage().define("balances", Balance.class)
.version(2)
.migrate(1, row -> new Balance(row.getLong("coins"), null))
.open();
-
Method Summary
-
Method Details
-
version
Schema version of the record, at least 1. Default: the record'sSchema, or 1. -
migrate
How to turn a row stored with schema versionfrominto the current record. Needed when the stored version is older thanversion(int)or the record changed in a way that cannot be applied without data.- Throws:
IllegalArgumentException- when a migration fromfromexists already, also one from aMigratemethod of the record
-
open
Creates the table, or checks the stored one against the record and migrates it.- Throws:
StorageException- when the stored table does not match and no migration applies
-