cmu.survey.data
Class TableVersionStorage
java.lang.Object
cmu.survey.data.TableVersionStorage
public class TableVersionStorage
- extends java.lang.Object
Check what version of the table is in the database before upgrading to a new
one. So, if the table would actually be going backwards in version, you won't
down-grade it, but just give the user an error message saying they're using a
too-old version of the program and it needs to be upgraded.
Method Summary |
java.lang.Integer |
getVersion(java.lang.String tableName)
|
boolean |
setVersion(java.lang.String tableName,
int version)
Set the cached version of this table in the database. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TableVersionStorage
public TableVersionStorage(TableStorage tableStorage)
getVersion
public java.lang.Integer getVersion(java.lang.String tableName)
setVersion
public boolean setVersion(java.lang.String tableName,
int version)
- Set the cached version of this table in the database.
This version number does not necessarily mean that all data is upgraded
in the table -- it just means that SOME of the data is specifically
upgraded for this version. For example, if the table version in the
database is 1, and one column is needed for access by version 2, it will
create that one column and set the version to 2. This doesn't mean
everything has been created, it just means that some of it has been
created. Only the necessary bits get upgraded as they're needed, thus
you're more likely to be able to use the database with an old version of
the editor. Upgrading bit by bit is also more efficient, since we don't
need to search the entire table or check to see whether we're using the
latest version every time we access the table.
- Parameters:
tableName
- version
-
- Returns: