Package com.google.gerrit.server.schema
Class SchemaVersion
- java.lang.Object
- 
- com.google.gerrit.server.schema.SchemaVersion
 
- 
- Direct Known Subclasses:
- Schema_100,- Schema_101,- Schema_102,- Schema_103,- Schema_104,- Schema_105,- Schema_106,- Schema_107,- Schema_108,- Schema_109,- Schema_110,- Schema_111,- Schema_112,- Schema_113,- Schema_114,- Schema_115,- Schema_116,- Schema_117,- Schema_118,- Schema_119,- Schema_120,- Schema_121,- Schema_122,- Schema_123,- Schema_124,- Schema_125,- Schema_126,- Schema_127,- Schema_128,- Schema_129,- Schema_130,- Schema_131,- Schema_132,- Schema_133,- Schema_134,- Schema_135,- Schema_136,- Schema_137,- Schema_138,- Schema_139,- Schema_140,- Schema_141,- Schema_142,- Schema_143,- Schema_144,- Schema_145,- Schema_146,- Schema_147,- Schema_148,- Schema_149,- Schema_150,- Schema_151,- Schema_152,- Schema_153,- Schema_154,- Schema_155,- Schema_156,- Schema_157,- Schema_158,- Schema_159,- Schema_160,- Schema_161,- Schema_83,- Schema_84,- Schema_85,- Schema_86,- Schema_87,- Schema_88,- Schema_89,- Schema_90,- Schema_91,- Schema_92,- Schema_93,- Schema_94,- Schema_95,- Schema_96,- Schema_97,- Schema_98,- Schema_99
 
 public abstract class SchemaVersion extends Object A version of the database schema.
- 
- 
Field SummaryFields Modifier and Type Field Description static Class<Schema_161>CThe current schema version.
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedSchemaVersion(com.google.inject.Provider<? extends SchemaVersion> prior)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheck(UpdateUI ui, CurrentSchemaVersion curr, com.google.gwtorm.server.SchemaFactory<ReviewDb> schema)protected static voidexecute(ReviewDb db, String sql)Execute an SQL statement.protected voidfinish(CurrentSchemaVersion curr, ReviewDb db)Mark the current schema version.static intgetBinaryVersion()SchemaVersiongetPrior()intgetVersionNbr()static intguessVersion(Class<?> c)protected voidmigrateData(ReviewDb db, UpdateUI ui)Invoked between updateSchema (adds new columns/tables) and pruneSchema (removes deleted columns/tables).protected static com.google.gwtorm.jdbc.JdbcExecutornewExecutor(ReviewDb db)Open a new statement executor.protected static StatementnewStatement(ReviewDb db)Open a new single statement.protected static PreparedStatementprepareStatement(ReviewDb db, String sql)Open a new prepared statement.protected voidpreUpdateSchema(ReviewDb db)Invoked before updateSchema adds new columns/tables.protected static voidrenameColumn(ReviewDb db, String table, String from, String to)Rename an existing column.protected static voidrenameTable(ReviewDb db, String from, String to)Rename an existing table.
 
- 
- 
- 
Field Detail- 
Cpublic static final Class<Schema_161> C The current schema version.
 
- 
 - 
Constructor Detail- 
SchemaVersionprotected SchemaVersion(com.google.inject.Provider<? extends SchemaVersion> prior) 
 
- 
 - 
Method Detail- 
getBinaryVersionpublic static int getBinaryVersion() 
 - 
guessVersionpublic static int guessVersion(Class<?> c) 
 - 
getVersionNbrpublic final int getVersionNbr() - Returns:
- the CurrentSchemaVersion.versionNbrthis step targets.
 
 - 
getPriorpublic final SchemaVersion getPrior() 
 - 
checkpublic final void check(UpdateUI ui, CurrentSchemaVersion curr, com.google.gwtorm.server.SchemaFactory<ReviewDb> schema) throws com.google.gwtorm.server.OrmException, SQLException - Throws:
- com.google.gwtorm.server.OrmException
- SQLException
 
 - 
preUpdateSchemaprotected void preUpdateSchema(ReviewDb db) throws com.google.gwtorm.server.OrmException, SQLException Invoked before updateSchema adds new columns/tables.- Parameters:
- db- open database handle.
- Throws:
- com.google.gwtorm.server.OrmException- if a Gerrit-specific exception occurred.
- SQLException- if an underlying SQL exception occurred.
 
 - 
migrateDataprotected void migrateData(ReviewDb db, UpdateUI ui) throws com.google.gwtorm.server.OrmException, SQLException Invoked between updateSchema (adds new columns/tables) and pruneSchema (removes deleted columns/tables).- Parameters:
- db- open database handle.
- ui- interface for interacting with the user.
- Throws:
- com.google.gwtorm.server.OrmException- if a Gerrit-specific exception occurred.
- SQLException- if an underlying SQL exception occurred.
 
 - 
finishprotected void finish(CurrentSchemaVersion curr, ReviewDb db) throws com.google.gwtorm.server.OrmException Mark the current schema version.- Throws:
- com.google.gwtorm.server.OrmException
 
 - 
renameTableprotected static void renameTable(ReviewDb db, String from, String to) throws com.google.gwtorm.server.OrmException Rename an existing table.- Throws:
- com.google.gwtorm.server.OrmException
 
 - 
renameColumnprotected static void renameColumn(ReviewDb db, String table, String from, String to) throws com.google.gwtorm.server.OrmException Rename an existing column.- Throws:
- com.google.gwtorm.server.OrmException
 
 - 
executeprotected static void execute(ReviewDb db, String sql) throws SQLException Execute an SQL statement.- Throws:
- SQLException
 
 - 
newStatementprotected static Statement newStatement(ReviewDb db) throws SQLException Open a new single statement.- Throws:
- SQLException
 
 - 
prepareStatementprotected static PreparedStatement prepareStatement(ReviewDb db, String sql) throws SQLException Open a new prepared statement.- Throws:
- SQLException
 
 - 
newExecutorprotected static com.google.gwtorm.jdbc.JdbcExecutor newExecutor(ReviewDb db) throws com.google.gwtorm.server.OrmException Open a new statement executor.- Throws:
- com.google.gwtorm.server.OrmException
 
 
- 
 
-