public class FieldFactory extends java.lang.Object implements ProtocolEntityFactory<Field,XMessage>
Field from protocol message.| Modifier and Type | Field and Description |
|---|---|
(package private) java.lang.String |
metadataCharacterSet |
private static int |
XPROTOCOL_COLUMN_BYTES_CONTENT_TYPE_GEOMETRY
Content-type used in type mapping.
|
private static int |
XPROTOCOL_COLUMN_BYTES_CONTENT_TYPE_JSON |
private static int |
XPROTOCOL_COLUMN_FLAGS_AUTO_INCREMENT |
private static int |
XPROTOCOL_COLUMN_FLAGS_BYTES_RIGHTPAD |
private static int |
XPROTOCOL_COLUMN_FLAGS_DATETIME_TIMESTAMP |
private static int |
XPROTOCOL_COLUMN_FLAGS_DECIMAL_UNSIGNED |
private static int |
XPROTOCOL_COLUMN_FLAGS_DOUBLE_UNSIGNED |
private static int |
XPROTOCOL_COLUMN_FLAGS_FLOAT_UNSIGNED |
private static int |
XPROTOCOL_COLUMN_FLAGS_MULTIPLE_KEY |
private static int |
XPROTOCOL_COLUMN_FLAGS_NOT_NULL |
private static int |
XPROTOCOL_COLUMN_FLAGS_PRIMARY_KEY |
private static int |
XPROTOCOL_COLUMN_FLAGS_UINT_ZEROFILL |
private static int |
XPROTOCOL_COLUMN_FLAGS_UNIQUE_KEY |
| Constructor and Description |
|---|
FieldFactory(java.lang.String metadataCharSet) |
| Modifier and Type | Method and Description |
|---|---|
private Field |
columnMetaDataToField(MysqlxResultset.ColumnMetaData col,
java.lang.String characterSet)
Convert a X Protocol
MysqlxResultset.ColumnMetaData message to a C/J Field object. |
Field |
createFromMessage(XMessage message)
Create ProtocolEntity of type
T from protocol message. |
private MysqlType |
findMysqlType(MysqlxResultset.ColumnMetaData.FieldType type,
int contentType,
int flags,
int collationIndex) |
private int |
xProtocolTypeToMysqlType(MysqlxResultset.ColumnMetaData.FieldType type,
int contentType)
Map a X Protocol type code from `ColumnMetaData.FieldType' to a MySQL type constant.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateFromProtocolEntity, getFetchSize, getResultSetConcurrency, getResultSetTypeprivate static final int XPROTOCOL_COLUMN_BYTES_CONTENT_TYPE_GEOMETRY
private static final int XPROTOCOL_COLUMN_BYTES_CONTENT_TYPE_JSON
private static final int XPROTOCOL_COLUMN_FLAGS_UINT_ZEROFILL
private static final int XPROTOCOL_COLUMN_FLAGS_DOUBLE_UNSIGNED
private static final int XPROTOCOL_COLUMN_FLAGS_FLOAT_UNSIGNED
private static final int XPROTOCOL_COLUMN_FLAGS_DECIMAL_UNSIGNED
private static final int XPROTOCOL_COLUMN_FLAGS_BYTES_RIGHTPAD
private static final int XPROTOCOL_COLUMN_FLAGS_DATETIME_TIMESTAMP
private static final int XPROTOCOL_COLUMN_FLAGS_NOT_NULL
private static final int XPROTOCOL_COLUMN_FLAGS_PRIMARY_KEY
private static final int XPROTOCOL_COLUMN_FLAGS_UNIQUE_KEY
private static final int XPROTOCOL_COLUMN_FLAGS_MULTIPLE_KEY
private static final int XPROTOCOL_COLUMN_FLAGS_AUTO_INCREMENT
java.lang.String metadataCharacterSet
public Field createFromMessage(XMessage message)
ProtocolEntityFactoryT from protocol message.createFromMessage in interface ProtocolEntityFactory<Field,XMessage>message - Message instanceprivate Field columnMetaDataToField(MysqlxResultset.ColumnMetaData col, java.lang.String characterSet)
MysqlxResultset.ColumnMetaData message to a C/J Field object.col - the message from the servercharacterSet - the encoding of the strings in the messageFieldprivate MysqlType findMysqlType(MysqlxResultset.ColumnMetaData.FieldType type, int contentType, int flags, int collationIndex)
private int xProtocolTypeToMysqlType(MysqlxResultset.ColumnMetaData.FieldType type, int contentType)
XProtocolRow
results.type - the type as the ColumnMetaData.FieldTypecontentType - the inner typeMysqlType corresponding to the combination of input parameters.