|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.torque.templates.typemapping.SqlType
org.apache.torque.templates.typemapping.SizedForBitDataSqlType
public class SizedForBitDataSqlType
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:
setSchemaDomainMapping(new SizedForBitDataDomain(
SchemaType.BINARY, "CHAR", "1"));
setSchemaDomainMapping(new SizedForBitDataDomain(
SchemaType.VARBINARY, "VARCHAR"));
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
,
org.apache.torque.templates.transformer.sql.SQLTransformer#getSqlString()
Constructor Summary | |
---|---|
SizedForBitDataSqlType(SqlType sqlType,
String size,
String scale,
String defaultValue)
|
|
SizedForBitDataSqlType(String sqlType)
|
|
SizedForBitDataSqlType(String sqlType,
String size)
|
Method Summary | |
---|---|
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)
Returns the size postfix for the base SQL Column type. |
Methods inherited from class org.apache.torque.templates.typemapping.SqlType |
---|
getDefaultValue, getScale, getSize, getSqlTypeName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SizedForBitDataSqlType(String sqlType)
SqlType.SqlType(String)
public SizedForBitDataSqlType(String sqlType, String size)
SqlType.SqlType(String, String)
public SizedForBitDataSqlType(SqlType sqlType, String size, String scale, String defaultValue)
SqlType#SqlType(String, String, string, String)
Method Detail |
---|
public String printSize(String sizeSuffix)
printSize
in class SqlType
SqlType.database.model.Domain
public SqlType getNew(String size, String scale, String defaultValue)
getNew
in class SqlType
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |