Class CloudSpannerTypeInfo
- java.lang.Object
-
- org.datanucleus.store.rdbms.schema.SQLTypeInfo
-
- org.datanucleus.store.rdbms.adapter.CloudSpannerTypeInfo
-
- All Implemented Interfaces:
org.datanucleus.store.schema.StoreSchemaData
public class CloudSpannerTypeInfo extends SQLTypeInfo
SQL Type info for Google Cloud Spanner datastore.
-
-
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 CloudSpannerTypeInfo(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)
CloudSpannerTypeInfo(java.sql.ResultSet rs)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
fixAllowsPrecisionSpec()
private static boolean
isBooleanType(int type)
private static boolean
isByteType(int type)
boolean
isCompatibleWith(RDBMSColumnInfo colInfo)
Convenience method for returning if this type is compatible with the provided column.private static boolean
isStringType(int type)
Tests whether or not the given JDBC type is a Cloud Spanner "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
-
CloudSpannerTypeInfo
public CloudSpannerTypeInfo(java.sql.ResultSet rs)
-
CloudSpannerTypeInfo
public CloudSpannerTypeInfo(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)
Description copied from class:SQLTypeInfo
Convenience method for returning if this type is compatible with the provided column. Compares the data type of each record, and returns true if the types are equivalent. For example one could be VARCHAR, and the other LONGVARCHAR so they both store string data, and hence they are compatible.- Overrides:
isCompatibleWith
in classSQLTypeInfo
- Parameters:
colInfo
- The column- Returns:
- Whether they are considered compatible
-
isByteType
private static boolean isByteType(int type)
-
isBooleanType
private static boolean isBooleanType(int type)
-
isStringType
private static boolean isStringType(int type)
Tests whether or not the given JDBC type is a Cloud Spanner "string" type. For Spanner all character related types are indeed string
-
-