Column column = (Column) schemaTransaction.getTarget();
sql = "DELETE FROM `column` WHERE `column`.`ID` = " + column.getId() + ";";
}
}
} else if (transaction.getClass() == DataTransaction.class) {
DataTransaction dataTransaction = (DataTransaction) transaction;
String data = dataTransaction.getCell().getData();
if (dataTransaction.getType() == TransactionType.INSERT) {
if (data != null) {
sql = "INSERT INTO `cell`(`cell`.`PRIMARY_KEY_VALUE`, `cell`.`DATA`, `cell`.`COLUMN_ID`) VALUES('" + TransactionConverter.escapeSQL(dataTransaction.getCell().getPrimaryKeyValue()) + "', '" + TransactionConverter.escapeSQL(dataTransaction.getCell().getData()) + "', " + dataTransaction.getCell().getColumn().getId() + ");";
} else {
sql = "INSERT INTO `cell`(`cell`.`PRIMARY_KEY_VALUE`, `cell`.`DATA`, `cell`.`COLUMN_ID`) VALUES('" + TransactionConverter.escapeSQL(dataTransaction.getCell().getPrimaryKeyValue()) + "', NULL, " + dataTransaction.getCell().getColumn().getId() + ");";
}
} else if (dataTransaction.getType() == TransactionType.UPDATE) {
if (data != null) {
sql = "UPDATE `cell` SET `cell`.`DATA` = '" + TransactionConverter.escapeSQL(data) + "' WHERE `cell`.`ID` = " + dataTransaction.getCell().getId() + ";";
} else {
sql = "UPDATE `cell` SET `cell`.`DATA` = NULL WHERE `cell`.`ID` = " + dataTransaction.getCell().getId() + ";";
}
} else if (dataTransaction.getType() == TransactionType.DELETE) {
sql = "DELETE FROM `cell` WHERE `cell`.`ID` = " + dataTransaction.getCell().getId() + ";";
}
} else if (transaction.getClass() == LoggableTransaction.class) {
LoggableTransaction loggableTransaction = (LoggableTransaction) transaction;
sql = "INSERT INTO `transaction`(`transaction`.`TYPE`, `transaction`.`TABLE_ID`, `transaction`.`CREATED_DATETIME`) VALUES('" + loggableTransaction.getType() + "', " + loggableTransaction.getTable().getId() + ", NOW());";
} else if (transaction.getClass() == LoggableTransactionDatum.class) {