/**
* Write the indexes sql statements to add to the script.
*/
private void writeIndexesStatements() throws IOException {
if (!indexes.isEmpty()) {
PMapperRdb mapper = (PMapperRdb) msm.getPMapper();
msm.getFileWriter().write("----------- INDEXES ---------\n");
for (Iterator it = indexes.iterator(); it.hasNext();) {
SpeedoIndex si = (SpeedoIndex) it.next();
log("[DEBUG] SpeedoIndex " + si.name, Project.MSG_DEBUG);
if (isGenerateDrop()) {
msm.getFileWriter().write(
mapper.getRdbAdapter().getDropIndex(si.name, si.table) + "\n");
}
if (isGenerateCreate()) {
if (si.columnNames != null && si.columnNames.size() != 0) {
msm.getFileWriter().write(
mapper.getRdbAdapter().getCreateIndex(si.name, si.table, si.columnNames, si.unique)
+ "\n");
} else {
log("[INFO] Index " + si.name + " has not been processed.", Project.MSG_INFO);
}
}