Search in sources :

Example 1 with AlterTableRenameStatement

use of com.robotoworks.mechanoid.db.sqliteModel.AlterTableRenameStatement in project mechanoid by robotoworks.

the class ModelUtil method getHistory.

public static LinkedList<TableDefinition> getHistory(final TableDefinition ref) {
    LinkedList<TableDefinition> refs = new LinkedList<TableDefinition>();
    TableDefinition current = ref;
    while ((current instanceof AlterTableRenameStatement)) {
        {
            refs.add(current);
            TableDefinition _table = ((AlterTableRenameStatement) current).getTable();
            current = _table;
        }
    }
    refs.add(current);
    return refs;
}
Also used : TableDefinition(com.robotoworks.mechanoid.db.sqliteModel.TableDefinition) AlterTableRenameStatement(com.robotoworks.mechanoid.db.sqliteModel.AlterTableRenameStatement) LinkedList(java.util.LinkedList)

Aggregations

AlterTableRenameStatement (com.robotoworks.mechanoid.db.sqliteModel.AlterTableRenameStatement)1 TableDefinition (com.robotoworks.mechanoid.db.sqliteModel.TableDefinition)1 LinkedList (java.util.LinkedList)1