|
|||||||||
| Home >> All >> org >> apache >> derby >> iapi >> sql >> [ compile overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.iapi.sql.compile
Interface TypeCompiler

- public interface TypeCompiler
This interface defines methods associated with a TypeId that are used by the compiler.
| Field Summary | |
static java.lang.String |
AVG_OP
|
static int |
BOOLEAN_MAXWIDTH_AS_CHAR
|
static int |
DEFAULT_DECIMAL_PRECISION
|
static int |
DEFAULT_DECIMAL_SCALE
|
static java.lang.String |
DIVIDE_OP
|
static int |
DOUBLE_MAXWIDTH_AS_CHAR
|
static int |
INT_MAXWIDTH_AS_CHAR
|
static int |
LONGINT_MAXWIDTH_AS_CHAR
Various fixed numbers related to datatypes. |
static int |
MAX_DECIMAL_PRECISION_SCALE
|
static java.lang.String |
MINUS_OP
|
static java.lang.String |
MOD_OP
|
static java.lang.String |
PLUS_OP
|
static int |
REAL_MAXWIDTH_AS_CHAR
|
static int |
SMALLINT_MAXWIDTH_AS_CHAR
|
static java.lang.String |
SUM_OP
|
static java.lang.String |
TIMES_OP
|
static int |
TINYINT_MAXWIDTH_AS_CHAR
|
| Method Summary | |
boolean |
comparable(org.apache.derby.iapi.types.TypeId otherType,
boolean forEquals,
org.apache.derby.iapi.services.loader.ClassFactory cf)
Determine if this type can be compared to some other type |
boolean |
compatible(org.apache.derby.iapi.types.TypeId otherType)
Determine if this type is compatible to some other type (e.g. |
boolean |
convertible(org.apache.derby.iapi.types.TypeId otherType,
boolean forDataTypeFunction)
Determine if this type can be CONVERTed to some other type |
void |
generateDataValue(org.apache.derby.iapi.services.compiler.MethodBuilder eb,
org.apache.derby.iapi.services.compiler.LocalField field)
Generate the code necessary to produce a SQL value based on a value. |
void |
generateNull(org.apache.derby.iapi.services.compiler.MethodBuilder mb)
Generate the code necessary to produce a SQL null of the appropriate type. |
int |
getCastToCharWidth(org.apache.derby.iapi.types.DataTypeDescriptor dts)
Return the maximum width for this data type when cast to a char type. |
java.lang.String |
getCorrespondingPrimitiveTypeName()
Get the name of the corresponding Java type. |
java.lang.String |
getMatchingNationalCharTypeName()
Get the name of the matching national char type. |
java.lang.String |
getPrimitiveMethodName()
Get the method name for getting out the corresponding primitive Java type from a DataValueDescriptor. |
java.lang.String |
interfaceName()
Get the name of the interface for this type. |
org.apache.derby.iapi.types.DataTypeDescriptor |
resolveArithmeticOperation(org.apache.derby.iapi.types.DataTypeDescriptor leftType,
org.apache.derby.iapi.types.DataTypeDescriptor rightType,
java.lang.String operator)
Type resolution methods on binary operators |
boolean |
storable(org.apache.derby.iapi.types.TypeId otherType,
org.apache.derby.iapi.services.loader.ClassFactory cf)
Determine if this type can have a value of another type stored into it. |
| Field Detail |
LONGINT_MAXWIDTH_AS_CHAR
public static final int LONGINT_MAXWIDTH_AS_CHAR
- Various fixed numbers related to datatypes.
- See Also:
- Constant Field Values
INT_MAXWIDTH_AS_CHAR
public static final int INT_MAXWIDTH_AS_CHAR
- See Also:
- Constant Field Values
SMALLINT_MAXWIDTH_AS_CHAR
public static final int SMALLINT_MAXWIDTH_AS_CHAR
- See Also:
- Constant Field Values
TINYINT_MAXWIDTH_AS_CHAR
public static final int TINYINT_MAXWIDTH_AS_CHAR
- See Also:
- Constant Field Values
DOUBLE_MAXWIDTH_AS_CHAR
public static final int DOUBLE_MAXWIDTH_AS_CHAR
- See Also:
- Constant Field Values
REAL_MAXWIDTH_AS_CHAR
public static final int REAL_MAXWIDTH_AS_CHAR
- See Also:
- Constant Field Values
DEFAULT_DECIMAL_PRECISION
public static final int DEFAULT_DECIMAL_PRECISION
- See Also:
- Constant Field Values
DEFAULT_DECIMAL_SCALE
public static final int DEFAULT_DECIMAL_SCALE
- See Also:
- Constant Field Values
MAX_DECIMAL_PRECISION_SCALE
public static final int MAX_DECIMAL_PRECISION_SCALE
- See Also:
- Constant Field Values
BOOLEAN_MAXWIDTH_AS_CHAR
public static final int BOOLEAN_MAXWIDTH_AS_CHAR
- See Also:
- Constant Field Values
PLUS_OP
public static final java.lang.String PLUS_OP
- See Also:
- Constant Field Values
DIVIDE_OP
public static final java.lang.String DIVIDE_OP
- See Also:
- Constant Field Values
MINUS_OP
public static final java.lang.String MINUS_OP
- See Also:
- Constant Field Values
TIMES_OP
public static final java.lang.String TIMES_OP
- See Also:
- Constant Field Values
SUM_OP
public static final java.lang.String SUM_OP
- See Also:
- Constant Field Values
AVG_OP
public static final java.lang.String AVG_OP
- See Also:
- Constant Field Values
MOD_OP
public static final java.lang.String MOD_OP
- See Also:
- Constant Field Values
| Method Detail |
resolveArithmeticOperation
public org.apache.derby.iapi.types.DataTypeDescriptor resolveArithmeticOperation(org.apache.derby.iapi.types.DataTypeDescriptor leftType, org.apache.derby.iapi.types.DataTypeDescriptor rightType, java.lang.String operator) throws org.apache.derby.iapi.error.StandardException
- Type resolution methods on binary operators
comparable
public boolean comparable(org.apache.derby.iapi.types.TypeId otherType, boolean forEquals, org.apache.derby.iapi.services.loader.ClassFactory cf)
- Determine if this type can be compared to some other type
convertible
public boolean convertible(org.apache.derby.iapi.types.TypeId otherType, boolean forDataTypeFunction)
- Determine if this type can be CONVERTed to some other type
compatible
public boolean compatible(org.apache.derby.iapi.types.TypeId otherType)
- Determine if this type is compatible to some other type
(e.g. COALESCE(thistype, othertype)).
storable
public boolean storable(org.apache.derby.iapi.types.TypeId otherType, org.apache.derby.iapi.services.loader.ClassFactory cf)
- Determine if this type can have a value of another type stored into it.
Note that direction is relevant here: the test is that the otherType
is storable into this type.
interfaceName
public java.lang.String interfaceName()
- Get the name of the interface for this type. For example, the interface
for a SQLInteger is NumberDataValue. The full path name of the type
is returned.
getCorrespondingPrimitiveTypeName
public java.lang.String getCorrespondingPrimitiveTypeName()
- Get the name of the corresponding Java type. For numerics and booleans
we will get the corresponding Java primitive type.
e
Each SQL type has a corresponding Java type. When a SQL value is
passed to a Java method, it is translated to its corresponding Java
type. For example, a SQL Integer will be mapped to a Java int, but
a SQL date will be mapped to a java.sql.Date.
getPrimitiveMethodName
public java.lang.String getPrimitiveMethodName()
- Get the method name for getting out the corresponding primitive
Java type from a DataValueDescriptor.
getMatchingNationalCharTypeName
public java.lang.String getMatchingNationalCharTypeName()
- Get the name of the matching national char type.
generateNull
public void generateNull(org.apache.derby.iapi.services.compiler.MethodBuilder mb)
- Generate the code necessary to produce a SQL null of the appropriate
type. The stack must contain a DataValueFactory and a null or a value
of the correct type (interfaceName()).
generateDataValue
public void generateDataValue(org.apache.derby.iapi.services.compiler.MethodBuilder eb, org.apache.derby.iapi.services.compiler.LocalField field)
- Generate the code necessary to produce a SQL value based on
a value. The value's type is assumed to match
the type of this TypeId. For example, a TypeId
for the SQL int type should be given an value that evaluates
to a Java int or Integer.
If the type of the value is incorrect, the generated code will
not work.
The stack must contain
data value factory
value
getCastToCharWidth
public int getCastToCharWidth(org.apache.derby.iapi.types.DataTypeDescriptor dts)
- Return the maximum width for this data type when cast to a char type.
|
|||||||||
| Home >> All >> org >> apache >> derby >> iapi >> sql >> [ compile overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC