public class SizedForBitDataSqlType extends SqlType
Supports the Derby / DB2 / SQL92 standard for defining Binary data fields with either CHAR(#) FOR BIT DATA or VARCHAR(#) FOR BIT DATA. This can be used in Platform implementors initialize() methods, by using lines like:
setSchemaTypeToSqlTypeMapping(
SchemaType.VARBINARY,
new SizedForBitDataSqlType("VARCHAR", "32672"));
This will cause the Column.getSqlString() method to produce items similar to:
CHAR(#) FOR BIT DATA
VARCHAR(#) FOR BIT DATA
Where: # is the size= schema attribute or a default size specified in the constructor.
Note that this is dependent on the platform implementation correctly defining BINARY and VARBINARY as having a size attribute in the "hasSize()" method.
Platform
Constructor and Description |
---|
SizedForBitDataSqlType(SqlType sqlType,
String size,
String scale,
String defaultValue) |
SizedForBitDataSqlType(String sqlType) |
SizedForBitDataSqlType(String sqlType,
String size) |
Modifier and Type | Method and Description |
---|---|
SqlType |
getNew(String size,
String scale,
String defaultValue)
Returns a new instance with the given sqlTypeName, size, scale
and default value.
|
String |
printSize(String sizeSuffix)
Return the size and scale in brackets for use in an SQL script.
|
getDefaultValue, getScale, getSize, getSqlTypeName, printScale
public SizedForBitDataSqlType(String sqlType)
sqlType
- the sql typepublic SizedForBitDataSqlType(String sqlType, String size)
sqlType
- the sql typesize
- sizepublic String printSize(String sizeSuffix)
SqlType
printSize
in class SqlType
Returns the size postfix for the base SQL Column type.
Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.