cmu.survey.editor.data.sql
Class DataBitStorageSQL
java.lang.Object
cmu.survey.editor.data.table.DataBitStorageTable
cmu.survey.editor.data.sql.DataBitStorageSQL
- All Implemented Interfaces:
- DataBitStorage
public class DataBitStorageSQL
- extends DataBitStorageTable
Methods inherited from class cmu.survey.editor.data.table.DataBitStorageTable |
close, deleteAuxillaryOption, deleteDataBits, errorCanBeFixedBySystem, getAllPossibleAnswerTableModels, getAllPossibleAnswerTables, getAnswersTable, getAnswersTable, getAnswersTableFormat, getAnswersTableNamed, getAuxillaryOptions, getAuxillaryOptionsTable, getAuxillaryOptionsTableFormat, getIntegerBitFrom, getNewAuxillaryOption, getNewChoice, getNewQuestion, getPage, getPages, getPagesOfQuestionsTable, getPagesOfQuestionsTableFormat, getQuestionsTable, getQuestionsTableFormat, getRepeatedMeasuresTableNamed, getRepeatedMeasureTableFormat, getStringBitFrom, getSurvey, getSurveyPagesTable, getSurveyPagesTableFormat, getSurveyTable, getTableNamed, getTableStorage, getUsersTable, isOpen, isSurveyValid, loadIntoNewAuxillaryOption, saveQuestionDataBits |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DataBitStorageSQL
public DataBitStorageSQL(TableStorageMySQL sqlStorage)
getNewQuestionStub
public QuestionDataBitSetTable getNewQuestionStub()
- Specified by:
getNewQuestionStub
in class DataBitStorageTable
getQuestion
public QuestionDataBitSetTable getQuestion(int questionID)
- Specified by:
getQuestion
in class DataBitStorageTable
getChoices
public ChoicesDataBitSetSQL getChoices(IntegerDataBit questionID,
StringDataBit choicesType,
IntegerDataBit numberOfChoices)
- Specified by:
getChoices
in class DataBitStorageTable
getNewPage
public PageTable getNewPage()
couldCreateNewSurveyInDatabase
protected boolean couldCreateNewSurveyInDatabase()
- Specified by:
couldCreateNewSurveyInDatabase
in class DataBitStorageTable
createNewSurveyInDatabase
public int createNewSurveyInDatabase()
- Description copied from interface:
DataBitStorage
- Fix a broken table by creating the survey database into this database.
This assumes the pre-req that you've called the isSurveyValid() method and gotten a ERROR_FIXABLE_CREATE as a response. If you haven't checked, it might not be possible, and if it's not possible, this will return false, perhaps gracefully or not.
- Specified by:
createNewSurveyInDatabase
in interface DataBitStorage
- Overrides:
createNewSurveyInDatabase
in class DataBitStorageTable
- Returns:
- OPERATION_SUCCEEDED, OPERATION_FAILED, or OPERATION_PARTIALLY_SUCCEEDED
getPage
protected PageTable getPage(ForwardOnlyData data)
- It's possible to have multiple pages by the same name. It's strongly discouraged!! It should be made impossible in the UI.
- Specified by:
getPage
in class DataBitStorageTable
- Parameters:
pageName
-
- Returns:
deleteDataBits
public boolean deleteDataBits(java.lang.String table,
java.lang.Integer id,
java.lang.String idFieldName)
- TODO replace this with the superclass's deleteDataBits which passes in a table too.
saveDataBits
public java.lang.Integer saveDataBits(java.util.List<? extends DataBit> dataBits,
java.lang.String table,
java.lang.Integer id,
java.lang.String idFieldName)
- Description copied from class:
DataBitStorageTable
- This should be replaced by DataTableModel.saveDataBits().
- Specified by:
saveDataBits
in class DataBitStorageTable
- Returns:
saveChoices
public boolean saveChoices(ChoicesDataBitSetSQL choicesSet)
backupToFile
public boolean backupToFile(java.io.File file,
java.lang.String mysqldumpLocation)
- Parameters:
file
- mysqldumpLocation
-
isSameStorageAs
public boolean isSameStorageAs(DataBitStorage storage)
- Specified by:
isSameStorageAs
in class DataBitStorageTable
main
public static void main(java.lang.String[] args)
throws java.lang.Throwable
- Throws:
java.lang.Throwable