Find column name of generated key.

@param logicTableName logic table name
@return column name of generated key
172744
public Optional<String> findGenerateKeyColumnName(final String logicTableName) {
        for (TableRule each : tableRules) {
            if (each.getLogicTable().equalsIgnoreCase(logicTableName) && null != each.getGenerateKeyColumn()) {
                return Optional.of(each.getGenerateKeyColumn());
            }
        }
        return Optional.absent();
    }
71686
public static Key[] getColumnNames(Query qry) {
	Query qp = Caster.toQuery(qry, null);

	if (qp != null) return qp.getColumnNames();
	String[] strNames = qry.getColumns();
	Key[] names = new Key[strNames.length];
	for (int i = 0; i < names.length; i++) {
	    names[i] = KeyImpl.getInstance(strNames[i]);
	}
	return names;
    }
651783
public FieldType getFieldTypeByColumnName(String columnName) {
		if (fieldNameMap == null) {
			// build our alias map if we need it
			Map<String, FieldType> map = new HashMap<String, FieldType>();
			for (FieldType fieldType : fieldTypes) {
				map.put(databaseType.downCaseString(fieldType.getColumnName(), true), fieldType);
			}
			fieldNameMap = map;
		}
		FieldType fieldType = fieldNameMap.get(databaseType.downCaseString(columnName, true));
		// if column name is found, return it
		if (fieldType != null) {
			return fieldType;
		}
		// look to see if someone is using the field-name instead of column-name
		for (FieldType fieldType2 : fieldTypes) {
			if (fieldType2.getFieldName().equals(columnName)) {
				throw new IllegalArgumentException("You should use columnName '" + fieldType2.getColumnName()
						+ "' for table " + tableName + " instead of fieldName '" + fieldType2.getFieldName() + "'");
			}
		}
		throw new IllegalArgumentException("Unknown column name '" + columnName + "' in table " + tableName);
	}
480766
private Optional<String> tryGetAttributeName(String tableName, String colName) {
    String attributeName;

    EntityTypeDescription entityTypeDescription =
        entityTypeRegistry.getEntityTypeDescription(tableName);
    if (entityTypeDescription != null) {
      AttributeDescription attrDescription =
          entityTypeDescription.getAttributeDescriptionMap().get(colName);
      if (attrDescription != null) {
        attributeName = attrDescription.getName();
      } else {
        attributeName = null;
      }
    } else {
      attributeName = null;
    }

    return Optional.ofNullable(attributeName);
  }
722439
public static String getClassNameFromTableModel(TableModel model) {
		DialectException.assureNotNull(model, "TableModel can not be null");
		String className;
		if (model.getEntityClass() != null)
			className = model.getEntityClass().getSimpleName();
		else {
			DialectException.assureNotEmpty(model.getTableName(), "TableName can not be empty in TableModel");
			className = StrUtils.toUpperCaseFirstOne(transColumnNameToFieldName(model.getTableName()));
		}
		DialectException.assureNotEmpty(className, "TableName can not be empty in TableModel");
		return className;
	}
718148
private String getDbTableName(String schemaName) {
    Preconditions.checkArgument(schemaName.matches(".+_.+_.+"));
    return schemaName.replaceFirst("_", ".").substring(0, schemaName.lastIndexOf('_'));
  }
314871
public String logicalCollectionColumnName(String columnName, String propertyName, String referencedColumn) {
    return Strings.isNotEmpty(columnName) ? columnName : unqualify(propertyName) + "_" + referencedColumn;
  }
491592
public boolean contains(final String logicTableName) {
        return findTableRule(logicTableName).isPresent() || findBindingTableRule(logicTableName).isPresent() || isBroadcastTable(logicTableName);
    }
1299262
@Override
    public String getName() {
        final String tableNamePrefix = StringUtils.isNotBlank(Latkes.getLocalProperty("jdbc.tablePrefix"))
                ? Latkes.getLocalProperty("jdbc.tablePrefix") + "_"
                : "";

        return tableNamePrefix + name;
    }
1124726
private String getIndirectionTableColName(TableAlias mnAlias, String path)
    {
        int dotIdx = path.lastIndexOf(".");
        String column = path.substring(dotIdx);
        return mnAlias.alias + column;
    }
861508
public String logicalColumnName(String columnName, String propertyName) {
    return Strings.isNotEmpty(columnName) ? columnName : propertyToColumnName(propertyName);
  }
146042
public Collection<String> getShardingLogicTableNames(final Collection<String> logicTableNames) {
        Collection<String> result = new LinkedList<>();
        for (String each : logicTableNames) {
            Optional<TableRule> tableRule = findTableRule(each);
            if (tableRule.isPresent()) {
                result.add(each);
            }
        }
        return result;
    }
449333
public Column getColumn(String columnName) {
    if (columnName == null) {
      return null;
    }
    for (Column column : columns) {
      if (columnName.equals(column.getData())) {
        return column;
      }
    }
    return null;
  }
1278594
public boolean isAllBindingTables(final Collection<String> logicTableNames) {
        if (logicTableNames.isEmpty()) {
            return false;
        }
        Optional<BindingTableRule> bindingTableRule = findBindingTableRule(logicTableNames);
        if (!bindingTableRule.isPresent()) {
            return false;
        }
        Collection<String> result = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
        result.addAll(bindingTableRule.get().getAllLogicTables());
        return !result.isEmpty() && result.containsAll(logicTableNames);
    }
48783
public boolean isBroadcastTable(final String logicTableName) {
        for (String each : broadcastTables) {
            if (each.equalsIgnoreCase(logicTableName)) {
                return true;
            }
        }
        return false;
    }
1197071
function findColumns (pgColumns, schemaName, tableName) {
  return pgColumns
    .filter(o => o.table_schema === schemaName && o.table_name === tableName)
    .reduce((columns, col) => {
      const columnInfo = {
        columnDefault: col.column_default,
        isNullable: col.is_nullable,
        dataType: col.data_type,
        characterMaximumLength: col.character_maximum_length,
        numericScale: col.numeric_scale,
        comment: col.column_comment
      }
      if (columnInfo.dataType === 'ARRAY') {
        columnInfo.array = true
        columnInfo.dataType = col.array_element_type.slice(1)
      } else {
        columnInfo.array = false
      }
      columns[col.column_name] = columnInfo
      return columns
    },
    {}
    )
}
311473
function getModelNameFor(table) {
    var schemaName = getSpecificConfig(table.name(), 'generate.modelCamelCase') ? inflection.camelize(inflection.underscore(table.schema().name()), true) : table.schema().name(),
        tableName  = getSpecificConfig(table.name(), 'generate.modelCamelCase') ? inflection.camelize(inflection.underscore(table.name()), true) : table.name();

    return getSpecificConfig(table.name(), 'generate.useSchemaName') ? schemaName + '.' + tableName : tableName;
}