public enum MySqlType extends Enum<MySqlType> implements io.r2dbc.spi.Type
| Enum Constant and Description |
|---|
BIGINT
A signed 64-bits integer type.
|
BIGINT_UNSIGNED
An unsigned 64-bits integer type.
|
BIT
A bitmap type.
|
BLOB
A binary type.
|
DATE
A date type.
|
DATETIME
A date time type.
|
DECIMAL
A decimal number type in string form.
|
DOUBLE
A IEEE-754 double-precision floating point number type.
|
ENUM
A enumerable string type.
|
FLOAT
A IEEE-754 single-precision floating point number type.
|
GEOMETRY
A geometry type.
|
INT
A signed 32-bits integer type.
|
INT_UNSIGNED
An unsigned 32-bits integer type.
|
JSON
A json type.
|
LONGBLOB
A binary type.
|
LONGTEXT
A string type.
|
MEDIUMBLOB
A binary type.
|
MEDIUMINT
A signed 24-bits integer type.
|
MEDIUMINT_UNSIGNED
An unsigned 24-bits integer type.
|
MEDIUMTEXT
A string type.
|
NULL
A
null type. |
SET
A string set type.
|
SMALLINT
A signed 16-bits integer type.
|
SMALLINT_UNSIGNED
An unsigned 16-bits integer type.
|
TEXT
A string type.
|
TIME
A time type.
|
TIMESTAMP
A timestamp type, it will automatically synchronize with the server timezone.
|
TINYBLOB
A binary type.
|
TINYINT
A signed 8-bits integer type.
|
TINYINT_UNSIGNED
An unsigned 8-bits integer type.
|
TINYTEXT
A string type.
|
UNKNOWN
Unknown type, should check the native type identifier and column definitions.
|
VARBINARY
A binary type.
|
VARCHAR
A variable-length string type.
|
YEAR
A year type.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getBinarySize()
Get the fixed byte size of the data type in the binary protocol, otherwise 0 means that
there is no fixed size.
|
int |
getId() |
Class<?> |
getJavaType() |
String |
getName() |
boolean |
isBinary()
Checks if this type can be decoded as a binary buffer, all string types should be
true. |
boolean |
isFractional()
Checks if this type can be decoded as a fractional number.
|
boolean |
isLob()
Checks if this type is a BLOB or CLOB.
|
boolean |
isNumeric()
Checks if this type is a numeric type.
|
boolean |
isString()
Checks if this type can be decoded as a string without loss of precision and without ambiguity in both
of text and binary protocol.
|
static MySqlType |
of(int id,
ColumnDefinition definition) |
static MySqlType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MySqlType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MySqlType UNKNOWN
public static final MySqlType DECIMAL
It should be defined as DECIMAL(M = 10, D = 0):
M is the maximum number of digits/precision. The range is 1 to 65D is the number of scale. The range is 0 to 30, cannot be greater than Mpublic static final MySqlType TINYINT
public static final MySqlType TINYINT_UNSIGNED
public static final MySqlType SMALLINT
public static final MySqlType SMALLINT_UNSIGNED
public static final MySqlType INT
public static final MySqlType INT_UNSIGNED
public static final MySqlType FLOAT
public static final MySqlType DOUBLE
public static final MySqlType NULL
null type.public static final MySqlType TIMESTAMP
public static final MySqlType BIGINT
public static final MySqlType BIGINT_UNSIGNED
public static final MySqlType MEDIUMINT
public static final MySqlType MEDIUMINT_UNSIGNED
public static final MySqlType DATE
public static final MySqlType TIME
public static final MySqlType DATETIME
public static final MySqlType YEAR
public static final MySqlType VARCHAR
NVARCHAR
is an alias of this type.public static final MySqlType BIT
public static final MySqlType JSON
Note: from MariaDB 10.2.7, it is an alias for LONGBLOB.
public static final MySqlType ENUM
ENUMERABLE in column
definitions and type is as VARCHAR.public static final MySqlType SET
SET in column definitions and type
is as VARCHAR.public static final MySqlType TINYBLOB
public static final MySqlType TINYTEXT
public static final MySqlType MEDIUMBLOB
public static final MySqlType MEDIUMTEXT
public static final MySqlType LONGBLOB
public static final MySqlType LONGTEXT
public static final MySqlType BLOB
public static final MySqlType TEXT
public static final MySqlType VARBINARY
public static final MySqlType GEOMETRY
Explaining this type is a huge task. It's recommended to find official documents to help.
public static MySqlType[] values()
for (MySqlType c : MySqlType.values()) System.out.println(c);
public static MySqlType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic int getId()
public Class<?> getJavaType()
getJavaType in interface io.r2dbc.spi.Typepublic String getName()
getName in interface io.r2dbc.spi.Typepublic boolean isLob()
public boolean isString()
Counterexample:
public boolean isNumeric()
YEAR is an 16-bits integer.public boolean isFractional()
public boolean isBinary()
true.public int getBinarySize()
public static MySqlType of(int id, ColumnDefinition definition)
Copyright © 2018–2023 asyncer.io. All rights reserved.