Maps which columns accept <code>null</code> and which don't.
@param tableMetadata The metadata about the table.
@return An array of the size of the number of columns with <code>true</code> set if the column is nullable.
356990
private boolean[] mapNullableColumns(TableColumnInfo tableMetadata)
    {
        boolean[] nullableColumns = new boolean[this.columns.length];

        for (int i = 0; i < this.columns.length; i++)
        {
            String column = columns[i];
            nullableColumns[i] = tableMetadata.getColumn(column).isNullable();
        }

        return nullableColumns;
    }
669130
public Map<String, String> getMetadata() {
    return metadata == null || Data.isNull(metadata) ? null : Collections.unmodifiableMap(metadata);
  }
271171
public void putPropertyMetadata(PropertyMetadata propertyMetadata) {
    String mappedName = propertyMetadata.getMappedName();
    PropertyMetadata old = propertyMetadataMap.put(mappedName, propertyMetadata);
    if (old != null) {
      String format = "Class %s has two fields, %s and %s, both mapped to the same property "
          + "name, %s";
      String message = String.format(format, clazz.getName(), old.getName(),
          propertyMetadata.getName(), mappedName);
      throw new EntityManagerException(message);
    }
  }
56332
public static ColumnMetadata named(String name) {
        return new ColumnMetadata(null, name, null, true, UNDEFINED, UNDEFINED);
    }
5805
private String[] getColumnNames(ResultSetMetaData rsmd) throws Exception {
        ArrayList<String> names = new ArrayList<String>();

        // Get result set meta data
        int numColumns = rsmd.getColumnCount();

        // Get the column names; column indices start from 1
        for (int i = 1; i < numColumns + 1; i++) {
            String columnName = rsmd.getColumnName(i);

            names.add(columnName);
        }

        return names.toArray(new String[0]);
    }
1149565
@java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getMetadata() {
    return getMetadataMap();
  }
1273471
protected List<ColumnDef> getColumnMeta(Cassandra.Client client, boolean cassandraStorage, boolean includeCompactValueColumn)
            throws InvalidRequestException,
            UnavailableException,
            TimedOutException,
            SchemaDisagreementException,
            TException,
            CharacterCodingException,
            org.apache.cassandra.exceptions.InvalidRequestException,
            ConfigurationException,
            NotFoundException
    {
        String query = "SELECT column_name, " +
                       "       validator, " +
                       "       index_type, " +
                       "       type " +
                       "FROM system.schema_columns " +
                       "WHERE keyspace_name = '%s' " +
                       "  AND columnfamily_name = '%s'";

        CqlResult result = client.execute_cql3_query(
                                   ByteBufferUtil.bytes(String.format(query, keyspace, column_family)),
                                   Compression.NONE,
                                   ConsistencyLevel.ONE);

        List<CqlRow> rows = result.rows;
        List<ColumnDef> columnDefs = new ArrayList<ColumnDef>();
        if (rows == null || rows.isEmpty())
        {
            // if CassandraStorage, just return the empty list
            if (cassandraStorage)
                return columnDefs;

            // otherwise for CqlNativeStorage, check metadata for classic thrift tables
            CFMetaData cfm = getCFMetaData(keyspace, column_family, client);
            for (ColumnDefinition def : cfm.regularAndStaticColumns())
            {
                ColumnDef cDef = new ColumnDef();
                String columnName = def.name.toString();
                String type = def.type.toString();
                logger.debug("name: {}, type: {} ", columnName, type);
                cDef.name = ByteBufferUtil.bytes(columnName);
                cDef.validation_class = type;
                columnDefs.add(cDef);
            }
            // we may not need to include the value column for compact tables as we 
            // could have already processed it as schema_columnfamilies.value_alias
            if (columnDefs.size() == 0 && includeCompactValueColumn && cfm.compactValueColumn() != null)
            {
                ColumnDefinition def = cfm.compactValueColumn();
                if ("value".equals(def.name.toString()))
                {
                    ColumnDef cDef = new ColumnDef();
                    cDef.name = def.name.bytes;
                    cDef.validation_class = def.type.toString();
                    columnDefs.add(cDef);
                }
            }
            return columnDefs;
        }

        Iterator<CqlRow> iterator = rows.iterator();
        while (iterator.hasNext())
        {
            CqlRow row = iterator.next();
            ColumnDef cDef = new ColumnDef();
            String type = ByteBufferUtil.string(row.getColumns().get(3).value);
            if (!type.equals("regular"))
                continue;
            cDef.setName(ByteBufferUtil.clone(row.getColumns().get(0).value));
            cDef.validation_class = ByteBufferUtil.string(row.getColumns().get(1).value);
            ByteBuffer indexType = row.getColumns().get(2).value;
            if (indexType != null)
                cDef.index_type = getIndexType(ByteBufferUtil.string(indexType));
            columnDefs.add(cDef);
        }
        return columnDefs;
    }
88131
public boolean hasTableOrColumn(String table, String column) {

        String tableName, columnName;
        boolean result;

        tableName = table == null ? null : table.toUpperCase();
        columnName = column == null ? null : column.toUpperCase();
        result = hasTableOrColumnCaseSensitive(tableName, columnName);

        if (!result) {
            tableName = table == null ? null : table.toLowerCase();
            columnName = column == null ? null : column.toLowerCase();
            result = result || hasTableOrColumnCaseSensitive(tableName, columnName);
        }

        return result;
    }
593759
private ColumnDef getColumnMetadata(ColumnInfo columnInfo, TableInfo tableInfo)
    {
        ColumnDef columnDef = new ColumnDef();
        columnDef.setName(columnInfo.getColumnName().getBytes());
        columnDef.setValidation_class(CassandraValidationClassMapper.getValidationClass(columnInfo.getType(),
                isCql3Enabled(tableInfo)));

        if (columnInfo.isIndexable())
        {
            IndexInfo indexInfo = tableInfo.getColumnToBeIndexed(columnInfo.getColumnName());
            columnDef.setIndex_type(CassandraIndexHelper.getIndexType(indexInfo.getIndexType()));
            // if (!indexInfo.getIndexName().equals(indexInfo.getColumnName()))
            // {
            // columnDef.setIndex_name(indexInfo.getIndexName());
            // }
        }
        return columnDef;
    }
270029
private Map<String, String> simpleColumnToPropertyMappings(Map<String, ColumnMetaData> cm){
		Map<String, String> result = new HashMap<String, String>(cm.size());
		for (Entry<String, ColumnMetaData> entry: cm.entrySet()){
			result.put(entry.getKey(), entry.getValue().getPropertyName());
		}
		return result;
	}
291933
public static CounterMetadata fromMap(Map<String, Object> data) {
        if (data == null) {
            return null;
        }
        CounterMetadata metadata = new CounterMetadata();
        Boolean boolValue = DPathUtils.getValue(data, KEY_COUNTER_COLUMN, Boolean.class);
        metadata.isCounterColumn = boolValue != null ? boolValue.booleanValue() : false;
        metadata.table = DPathUtils.getValue(data, KEY_TABLE, String.class);
        return metadata;
    }
325351
public static boolean hasNull(Object[] array, int[] columnMap) {

        int count = columnMap.length;

        for (int i = 0; i < count; i++) {
            if (array[columnMap[i]] == null) {
                return true;
            }
        }

        return false;
    }
610168
private String getColumnName(EntityMetadata metadata, String property) {
        MetamodelImpl metaModel =
            (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());
        String jpaColumnName = null;

        if (property.equals(((AbstractAttribute) metadata.getIdAttribute()).getJPAColumnName())) {
            jpaColumnName = CassandraUtilities.getIdColumnName(kunderaMetadata, metadata,
                ((CassandraClientBase) persistenceDelegeator.getClient(metadata)).getExternalProperties(),
                ((CassandraClientBase) persistenceDelegeator.getClient(metadata)).isCql3Enabled(metadata));
        } else {
            jpaColumnName = ((AbstractAttribute) metaModel.getEntityAttribute(metadata.getEntityClazz(), property))
                .getJPAColumnName();
        }
        return jpaColumnName;
    }
1154481
private List<ColumnTypeDataPair> getColumnValues(Map<String, ParameterBindingDTO> bindValues) throws BindException
  {
    List<ColumnTypeDataPair> columns = new ArrayList<>(bindValues.size());
    for (int i = 1; i <= bindValues.size(); i++)
    {
      // bindValues should have n entries with string keys 1 ... n and list values
      String key = Integer.toString(i);
      if (!bindValues.containsKey(key))
      {
        throw new BindException(
            String.format("Bind map with %d columns should contain key \"%d\"", bindValues.size(), i), BindException.Type.SERIALIZATION);
      }

      ParameterBindingDTO value = bindValues.get(key);
      try
      {
        String type = value.getType();
        List<String> list = (List<String>) value.getValue();
        List<String> convertedList = new ArrayList<>(list.size());
        if ("TIMESTAMP_LTZ".equals(type) || "TIMESTAMP_NTZ".equals(type))
        {
          for (String e : list)
          {
            convertedList.add(synchronizedTimestampFormat(e));
          }
        }
        else if ("DATE".equals(type))
        {
          for (String e : list)
          {
            convertedList.add(synchronizedDateFormat(e));
          }
        }
        else
        {
          convertedList = list;
        }
        columns.add(i - 1, new ColumnTypeDataPair(type, convertedList));
      }
      catch (ClassCastException ex)
      {
        throw new BindException("Value in binding DTO could not be cast to a list", BindException.Type.SERIALIZATION);
      }
    }
    return columns;
  }
324605
private void parsePropertiesMetadata(JsonParser jp) throws IOException, SQLException {
        jp.nextToken();//START_OBJECT {
        while (jp.nextToken() != JsonToken.END_OBJECT) {
            String fieldName = TableLocation.quoteIdentifier(jp.getText().toUpperCase(), isH2); //FIELD_NAME columnName 
            JsonToken value = jp.nextToken();
            if (null != value) switch (value) {
                case VALUE_STRING:
                    cachedColumnNames.put(fieldName, "VARCHAR");
                    break;
                case VALUE_TRUE:
                case VALUE_FALSE:
                    cachedColumnNames.put(fieldName, "BOOLEAN");
                    break;
                case VALUE_NUMBER_FLOAT:
                    cachedColumnNames.put(fieldName, "DOUBLE PRECISION");
                    break;
                case VALUE_NUMBER_INT:
                    cachedColumnNames.put(fieldName, "BIGINT");
                    break;
                case START_ARRAY:
                    cachedColumnNames.put(fieldName, "ARRAY");
                    parseArrayMetadata(jp);
                    break;
                case START_OBJECT:
                    cachedColumnNames.put(fieldName, "VARCHAR");
                    parseObjectMetadata(jp);
                    break;
                case VALUE_NULL:
                    cachedColumnNames.put(fieldName, "VARCHAR");
                //ignore other value
                default:
                    break;
            }
        }
    }
295235
private int[] getColumnList(OrderedHashSet set, Table table) {
        if (set == null) {
            return null;
        }
        return table.getColumnIndexes(set);
    }
1153280
public function getPrimaryKeyMetadata(): ?ColumnMetadata
    {
        $filteredColumnList = array_filter($this->columnMetadataList, function (ColumnMetadata $columnMetadata) {
            return $columnMetadata->isPrimaryKey();
        });

        return (count($filteredColumnList)) ? current($filteredColumnList) : null;
    }