public boolean renameColumn(String colummName, String newColumnName) { if (colummName == null || newColumnName == null || newColumnName.length() == 0) { return false; } int columnIndex = columnIndexOf(new SQLIdentifierExpr(colummName)); if (columnIndex == -1) { return false; } SQLColumnDefinition column = (SQLColumnDefinition) tableElementList.get(columnIndex); column.setName(new SQLIdentifierExpr(newColumnName)); return true; }
private boolean apply(SQLAlterTableAddColumn item) { int startIndex = tableElementList.size(); if (item.isFirst()) { startIndex = 0; } int afterIndex = columnIndexOf(item.getAfterColumn()); if (afterIndex != -1) { startIndex = afterIndex + 1; } int beforeIndex = columnIndexOf(item.getFirstColumn()); if (beforeIndex != -1) { startIndex = beforeIndex; } for (int i = 0; i < item.getColumns().size(); i++) { SQLColumnDefinition column = item.getColumns().get(i); tableElementList.add(i + startIndex, column); column.setParent(this); } return true; }
private boolean apply(SQLAlterTableRenameColumn item) { int columnIndex = columnIndexOf(item.getColumn()); if (columnIndex == -1) { return false; } SQLColumnDefinition column = (SQLColumnDefinition) tableElementList.get(columnIndex); column.setName(item.getTo().clone()); return true; }
public boolean renameColumn(String colummName, String newColumnName) { if (colummName == null || newColumnName == null || newColumnName.length() == 0) { return false; } int columnIndex = columnIndexOf(new SQLIdentifierExpr(colummName)); if (columnIndex == -1) { return false; } SQLColumnDefinition column = (SQLColumnDefinition) tableElementList.get(columnIndex); column.setName(new SQLIdentifierExpr(newColumnName)); return true; }
private boolean apply(SQLAlterTableAddColumn item) { int startIndex = tableElementList.size(); if (item.isFirst()) { startIndex = 0; } int afterIndex = columnIndexOf(item.getAfterColumn()); if (afterIndex != -1) { startIndex = afterIndex + 1; } int beforeIndex = columnIndexOf(item.getFirstColumn()); if (beforeIndex != -1) { startIndex = beforeIndex; } for (int i = 0; i < item.getColumns().size(); i++) { SQLColumnDefinition column = item.getColumns().get(i); tableElementList.add(i + startIndex, column); column.setParent(this); } return true; }
private boolean apply(SQLAlterTableRenameColumn item) { int columnIndex = columnIndexOf(item.getColumn()); if (columnIndex == -1) { return false; } SQLColumnDefinition column = (SQLColumnDefinition) tableElementList.get(columnIndex); column.setName(item.getTo().clone()); return true; }