public Column getColumn(String columnFamilyName, String columnName, boolean isInsert) {
if (database.getSettings().rowKey && Column.ROWKEY.equals(columnName))
return getRowKeyColumn();
if (columnFamilyName == null) {
Column c = shortColumnNameMap.get(columnName);
if (c != null)
return c;
}
columnName = getFullColumnName(columnFamilyName, columnName);
if (!isStatic && isInsert) {
if (doesColumnExist(columnName))
return getColumn(columnName);
else { //处理动态列
Column[] oldColumns = getColumns();
Column[] newColumns;
if (oldColumns == null)
newColumns = new Column[1];
else
newColumns = new Column[oldColumns.length + 1];
System.arraycopy(oldColumns, 0, newColumns, 0, oldColumns.length);
Column c = new Column(columnName);
addShortColumnName(c);
newColumns[oldColumns.length] = c;
setColumnsNoCheck(newColumns);
isColumnsModified = true;
ArrayList<Column> list = columnFamilyMap.get(c.getColumnFamilyName());
if (list == null) {
list = New.arrayList();
columnFamilyMap.put(c.getColumnFamilyName(), list);
}
list.add(c);
return c;
}
} else {