org.apache.torque.engine.database.model
Class SizedForBitDataDomain
java.lang.Object
org.apache.torque.engine.database.model.Domain
org.apache.torque.engine.database.model.SizedForBitDataDomain
public class SizedForBitDataDomain
- extends Domain
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 implimentors 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 implimentation correctly defining
BINARY and VARBINARY as having a size attribute in the "hasSize()" method.
- Author:
- Greg Monroe
- See Also:
Platform
,
Column.getSqlString()
Method Summary |
java.lang.String |
printSize()
Returns the size postfix for the base SQL Column type. |
Methods inherited from class org.apache.torque.engine.database.model.Domain |
copy, getDefaultSetting, getDefaultValue, getDescription, getName, getScale, getSize, getSqlType, getType, loadFromXML, replaceDefaultValue, replaceScale, replaceSize, replaceType, setDefaultValue, setDescription, setName, setScale, setSize, setSqlType, setType, setType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SizedForBitDataDomain
public SizedForBitDataDomain()
- See Also:
Domain.Domain()
SizedForBitDataDomain
public SizedForBitDataDomain(java.lang.String name)
- See Also:
Domain.Domain(String)
SizedForBitDataDomain
public SizedForBitDataDomain(SchemaType type)
- See Also:
Domain.Domain(SchemaType)
SizedForBitDataDomain
public SizedForBitDataDomain(SchemaType type,
java.lang.String sqlType)
- See Also:
Domain(SchemaType, String)
SizedForBitDataDomain
public SizedForBitDataDomain(SchemaType type,
java.lang.String sqlType,
java.lang.String size,
java.lang.String scale)
- See Also:
Domain(SchemaType, String, String, String)
SizedForBitDataDomain
public SizedForBitDataDomain(SchemaType type,
java.lang.String sqlType,
java.lang.String size)
- See Also:
Domain(SchemaType, String, String)
SizedForBitDataDomain
public SizedForBitDataDomain(Domain domain)
- See Also:
Domain(Domain)
printSize
public java.lang.String printSize()
- Returns the size postfix for the base SQL Column type.
- Overrides:
printSize
in class Domain
- Returns:
- "(size) FOR BIT DATA" or just " FOR BIT DATA" if size
is null.
- See Also:
Domain.getSize()
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.