com.mysql.cj.protocol

## Interface ColumnDefinition

All Superinterfaces:
  ProtocolEntity

All Known Subinterfaces:
  CachedResultSetMetaData

    public interface ColumnDefinition
    extends ProtocolEntity

Represents protocol specific result set metadata, eg., for native protocol, Protocol::ColumnDefinition41 protocol entity.

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `buildIndexMapping()` Builds a hash between column names and their indices for fast retrieval.
`void` `exportTo(ColumnDefinition columnDefinition)`
`int` `findColumn(String columnName, boolean useColumnNamesInFindColumn, int indexBase)`
`Map<String,Integer>` `getColumnLabelToIndex()`
`Map<String,Integer>` `getColumnNameToIndex()`
`Map<String,Integer>` `getColumnToIndexCache()`
`Field[]` `getFields()`
`Map<String,Integer>` `getFullColumnNameToIndex()`
`boolean` `hasBuiltIndexMapping()`
`boolean` `hasLargeFields()` Check if fields with type BLOB, MEDIUMBLOB, LONGBLOB, TEXT, MEDIUMTEXT or LONGTEXT exist in this ColumnDefinition.
`void` `initializeFrom(ColumnDefinition columnDefinition)`
`void` `setColumnLabelToIndex(Map<String,Integer> columnLabelToIndex)`
`void` `setColumnNameToIndex(Map<String,Integer> colNameToIndex)`
`void` `setColumnToIndexCache(Map<String,Integer> columnToIndexCache)`
`void` `setFields(Field[] fields)`
`void` `setFullColumnNameToIndex(Map<String,Integer> fullColNameToIndex)`

### Method Detail

#### getFields

    Field[] getFields()

#### setFields

    void setFields(Field[] fields)

#### buildIndexMapping

    void buildIndexMapping()

Builds a hash between column names and their indices for fast retrieval. This is done lazily to support findColumn() and get*(String), as it can be more expensive than just retrieving result set values by ordinal index.

#### hasBuiltIndexMapping

    boolean hasBuiltIndexMapping()

#### getColumnLabelToIndex

    Map<String,Integer> getColumnLabelToIndex()

#### setColumnLabelToIndex

    void setColumnLabelToIndex(Map<String,Integer> columnLabelToIndex)

#### getFullColumnNameToIndex

    Map<String,Integer> getFullColumnNameToIndex()

#### setFullColumnNameToIndex

    void setFullColumnNameToIndex(Map<String,Integer> fullColNameToIndex)

#### getColumnNameToIndex

    Map<String,Integer> getColumnNameToIndex()

#### setColumnNameToIndex

    void setColumnNameToIndex(Map<String,Integer> colNameToIndex)

#### getColumnToIndexCache

    Map<String,Integer> getColumnToIndexCache()

#### setColumnToIndexCache

    void setColumnToIndexCache(Map<String,Integer> columnToIndexCache)

#### initializeFrom

    void initializeFrom(ColumnDefinition columnDefinition)

#### exportTo

    void exportTo(ColumnDefinition columnDefinition)

#### findColumn

    int findColumn(String columnName,
                   boolean useColumnNamesInFindColumn,
                   int indexBase)

#### hasLargeFields

    boolean hasLargeFields()

Check if fields with type BLOB, MEDIUMBLOB, LONGBLOB, TEXT, MEDIUMTEXT or LONGTEXT exist in this ColumnDefinition.

Returns:
  true if fields with type BLOB, MEDIUMBLOB, LONGBLOB, TEXT, MEDIUMTEXT or LONGTEXT exist in this ColumnDefinition.

Copyright © 2016, 2026, Oracle and/or its affiliates.