Class MySQLTypeInfo
- java.lang.Object
-
- org.datanucleus.store.rdbms.schema.SQLTypeInfo
-
- org.datanucleus.store.rdbms.adapter.MySQLTypeInfo
-
- All Implemented Interfaces:
org.datanucleus.store.schema.StoreSchemaData
public class MySQLTypeInfo extends SQLTypeInfo
SQL Type info for MySQL datastores.
-
-
Field Summary
-
Fields inherited from class org.datanucleus.store.rdbms.schema.SQLTypeInfo
allowsPrecisionSpec, autoIncrement, caseSensitive, createParams, dataType, fixedPrecScale, fromJdbcDriver, literalPrefix, literalSuffix, localTypeName, maximumScale, minimumScale, nullable, numPrecRadix, precision, searchable, typeName, unsignedAttribute
-
-
Constructor Summary
Constructors Constructor Description MySQLTypeInfo(java.lang.String typeName, short dataType, int precision, java.lang.String literalPrefix, java.lang.String literalSuffix, java.lang.String createParams, int nullable, boolean caseSensitive, short searchable, boolean unsignedAttribute, boolean fixedPrecScale, boolean autoIncrement, java.lang.String localTypeName, short minimumScale, short maximumScale, int numPrecRadix)
MySQLTypeInfo(java.sql.ResultSet rs)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
fixAllowsPrecisionSpec()
boolean
isCompatibleWith(RDBMSColumnInfo colInfo)
Utility to check the compatibility of this type with the supplied Column type.private static boolean
isStringType(int type)
Tests whether or not the given JDBC type is a MySQL "string" type.-
Methods inherited from class org.datanucleus.store.rdbms.schema.SQLTypeInfo
addProperty, equals, getCreateParams, getDataType, getLiteralPrefix, getLiteralSuffix, getLocalTypeName, getMaximumScale, getMinimumScale, getNullable, getNumPrecRadix, getPrecision, getProperty, getSearchable, getTypeName, hashCode, isAllowsPrecisionSpec, isAutoIncrement, isCaseSensitive, isFixedPrecScale, isUnsignedAttribute, setAllowsPrecisionSpec, setLocalTypeName, setTypeName, toString, toString
-
-
-
-
Constructor Detail
-
MySQLTypeInfo
public MySQLTypeInfo(java.sql.ResultSet rs)
Constructor- Parameters:
rs
- Result set from the database metadata
-
MySQLTypeInfo
public MySQLTypeInfo(java.lang.String typeName, short dataType, int precision, java.lang.String literalPrefix, java.lang.String literalSuffix, java.lang.String createParams, int nullable, boolean caseSensitive, short searchable, boolean unsignedAttribute, boolean fixedPrecScale, boolean autoIncrement, java.lang.String localTypeName, short minimumScale, short maximumScale, int numPrecRadix)
-
-
Method Detail
-
fixAllowsPrecisionSpec
private void fixAllowsPrecisionSpec()
-
isCompatibleWith
public boolean isCompatibleWith(RDBMSColumnInfo colInfo)
Utility to check the compatibility of this type with the supplied Column type.- Overrides:
isCompatibleWith
in classSQLTypeInfo
- Parameters:
colInfo
- The Column type- Returns:
- Whether they are compatible
-
isStringType
private static boolean isStringType(int type)
Tests whether or not the given JDBC type is a MySQL "string" type.MySQL likes to interchange CHAR and VARCHAR at its own discretion, and automatically upgrades types to bigger types if necessary. In addition, we use the BINARY qualifier on CHAR and VARCHAR to get case-sensitive treatment. Taken together it means we really can't distinguish one string/binary type from another so we treat them all as one big happy string family.
-
-