Package org.mariadb.jdbc.message.server

## Class ColumnDefinitionPacket

- java.lang.Object
- - org.mariadb.jdbc.message.server.ColumnDefinitionPacket

All Implemented Interfaces:
  `org.mariadb.jdbc.client.Column`, `org.mariadb.jdbc.message.ServerMessage`

    public class ColumnDefinitionPacket
    extends Object
    implements org.mariadb.jdbc.client.Column, org.mariadb.jdbc.message.ServerMessage

Column metadata definition

### Constructor Summary

Constructors
`ColumnDefinitionPacket​(org.mariadb.jdbc.client.ReadableByteBuf buf, boolean extendedInfo)` Generate object from mysql packet

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static ColumnDefinitionPacket` `create​(String name, org.mariadb.jdbc.client.DataType type, int flags)` Generate column definition from name
`boolean` `equals​(Object o)`
`String` `getColumnAlias()` retrieve column alias if any
`String` `getColumnName()` retrieve column name if any
`int` `getColumnType​(Configuration conf)` return column type from column server type
`String` `getColumnTypeName​(Configuration conf)` Retrieves the designated column's MariaDB/MySQL type name
`byte` `getDecimals()` get number of decimal
`Codec<?>` `getDefaultCodec​(Configuration conf)` return column codec from column server type
`int` `getDisplaySize()` get display size
`String` `getExtTypeName()` retrieve extended metadata name if any
`int` `getFlags()` Retrieve metadata flag
`long` `getLength()` column maximum length if known
`int` `getPrecision()` Return metadata precision.
`String` `getSchema()` get column schema
`String` `getTable()` retrieve table name if any
`String` `getTableAlias()` retrieve table alias if any
`org.mariadb.jdbc.client.DataType` `getType()` server data type
`boolean` `hasDefault()` Column has a default value
`int` `hashCode()`
`boolean` `isAutoIncrement()` Column autoincrement
`boolean` `isBinary()` indicate if column is of binary type.
`boolean` `isPrimaryKey()` Is column a primary key
`boolean` `isSigned()` Is column signed (for number only)
`void` `useAliasAsName()` Use column alias as name

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ColumnDefinitionPacket

    public ColumnDefinitionPacket​(org.mariadb.jdbc.client.ReadableByteBuf buf,
                                  boolean extendedInfo)

Generate object from mysql packet

Parameters:
  `buf` - mysql packet buffer
  `extendedInfo` - support extended information

### Method Detail

#### create

    public static ColumnDefinitionPacket create​(String name,
                                                org.mariadb.jdbc.client.DataType type,
                                                int flags)

Generate column definition from name

Parameters:
  `name` - column name
  `type` - server type
  `flags` - columns flags
Returns:
  column definition

#### getSchema

    public String getSchema()

Description copied from interface: `org.mariadb.jdbc.client.Column`
get column schema

Specified by:
  `getSchema` in interface `org.mariadb.jdbc.client.Column`
Returns:
  column schema

#### getTableAlias

    public String getTableAlias()

Description copied from interface: `org.mariadb.jdbc.client.Column`
retrieve table alias if any

Specified by:
  `getTableAlias` in interface `org.mariadb.jdbc.client.Column`
Returns:
  table alias

#### getTable

    public String getTable()

Description copied from interface: `org.mariadb.jdbc.client.Column`
retrieve table name if any

Specified by:
  `getTable` in interface `org.mariadb.jdbc.client.Column`
Returns:
  table name

#### getColumnAlias

    public String getColumnAlias()

Description copied from interface: `org.mariadb.jdbc.client.Column`
retrieve column alias if any

Specified by:
  `getColumnAlias` in interface `org.mariadb.jdbc.client.Column`
Returns:
  column alias

#### getColumnName

    public String getColumnName()

Description copied from interface: `org.mariadb.jdbc.client.Column`
retrieve column name if any

Specified by:
  `getColumnName` in interface `org.mariadb.jdbc.client.Column`
Returns:
  column name

#### getLength

    public long getLength()

Description copied from interface: `org.mariadb.jdbc.client.Column`
column maximum length if known

Specified by:
  `getLength` in interface `org.mariadb.jdbc.client.Column`
Returns:
  column maximum length

#### getType

    public org.mariadb.jdbc.client.DataType getType()

Description copied from interface: `org.mariadb.jdbc.client.Column`
server data type

Specified by:
  `getType` in interface `org.mariadb.jdbc.client.Column`
Returns:
  server data type

#### getDecimals

    public byte getDecimals()

Description copied from interface: `org.mariadb.jdbc.client.Column`
get number of decimal

Specified by:
  `getDecimals` in interface `org.mariadb.jdbc.client.Column`
Returns:
  number of decimal

#### isSigned

    public boolean isSigned()

Description copied from interface: `org.mariadb.jdbc.client.Column`
Is column signed (for number only)

Specified by:
  `isSigned` in interface `org.mariadb.jdbc.client.Column`
Returns:
  is signed

#### getDisplaySize

    public int getDisplaySize()

Description copied from interface: `org.mariadb.jdbc.client.Column`
get display size

Specified by:
  `getDisplaySize` in interface `org.mariadb.jdbc.client.Column`
Returns:
  display sier

#### isPrimaryKey

    public boolean isPrimaryKey()

Description copied from interface: `org.mariadb.jdbc.client.Column`
Is column a primary key

Specified by:
  `isPrimaryKey` in interface `org.mariadb.jdbc.client.Column`
Returns:
  is a primary key

#### isAutoIncrement

    public boolean isAutoIncrement()

Description copied from interface: `org.mariadb.jdbc.client.Column`
Column autoincrement

Specified by:
  `isAutoIncrement` in interface `org.mariadb.jdbc.client.Column`
Returns:
  true if column auto-increment

#### hasDefault

    public boolean hasDefault()

Description copied from interface: `org.mariadb.jdbc.client.Column`
Column has a default value

Specified by:
  `hasDefault` in interface `org.mariadb.jdbc.client.Column`
Returns:
  indicate if has a default value

#### isBinary

    public boolean isBinary()

Description copied from interface: `org.mariadb.jdbc.client.Column`
indicate if column is of binary type. doesn't use flag BINARY filter, because char binary and varchar binary are not binary (handle like string), but have binary flag

Specified by:
  `isBinary` in interface `org.mariadb.jdbc.client.Column`
Returns:
  is column type binary

#### getFlags

    public int getFlags()

Description copied from interface: `org.mariadb.jdbc.client.Column`
Retrieve metadata flag

Specified by:
  `getFlags` in interface `org.mariadb.jdbc.client.Column`
Returns:
  metadata flag

#### getExtTypeName

    public String getExtTypeName()

Description copied from interface: `org.mariadb.jdbc.client.Column`
retrieve extended metadata name if any

Specified by:
  `getExtTypeName` in interface `org.mariadb.jdbc.client.Column`
Returns:
  extended metadata name

#### getPrecision

    public int getPrecision()

Return metadata precision.

Specified by:
  `getPrecision` in interface `org.mariadb.jdbc.client.Column`
Returns:
  precision

#### getColumnTypeName

    public String getColumnTypeName​(Configuration conf)

Description copied from interface: `org.mariadb.jdbc.client.Column`
Retrieves the designated column's MariaDB/MySQL type name

Specified by:
  `getColumnTypeName` in interface `org.mariadb.jdbc.client.Column`
Parameters:
  `conf` - configuration
Returns:
  type name used by the database

#### getColumnType

    public int getColumnType​(Configuration conf)

Description copied from interface: `org.mariadb.jdbc.client.Column`
return column type from column server type

Specified by:
  `getColumnType` in interface `org.mariadb.jdbc.client.Column`
Parameters:
  `conf` - configuration
Returns:
  column type

#### getDefaultCodec

    public Codec<?> getDefaultCodec​(Configuration conf)

Description copied from interface: `org.mariadb.jdbc.client.Column`
return column codec from column server type

Specified by:
  `getDefaultCodec` in interface `org.mariadb.jdbc.client.Column`
Parameters:
  `conf` - configuration
Returns:
  decoding codec

#### equals

    public boolean equals​(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### useAliasAsName

    public void useAliasAsName()

Description copied from interface: `org.mariadb.jdbc.client.Column`
Use column alias as name

Specified by:
  `useAliasAsName` in interface `org.mariadb.jdbc.client.Column`