BaseTypeCompiler
, BitTypeCompiler
, BooleanTypeCompiler
, CharTypeCompiler
, CLOBTypeCompiler
, DateTypeCompiler
, LOBTypeCompiler
, NumericTypeCompiler
, RefTypeCompiler
, TimestampTypeCompiler
, TimeTypeCompiler
, UserDefinedTypeCompiler
, XMLTypeCompiler
public interface TypeCompiler
Modifier and Type | Field | Description |
---|---|---|
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 |
Modifier and Type | Method | Description |
---|---|---|
boolean |
compatible(TypeId otherType) |
Determine if this type is compatible to some other type
(e.g.
|
boolean |
convertible(TypeId otherType,
boolean forDataTypeFunction) |
Determine if this type can be CONVERTed to some other type
|
void |
generateDataValue(MethodBuilder mb,
int collationType,
LocalField field) |
Generate the code necessary to produce a SQL value based on
a value.
|
void |
generateNull(MethodBuilder mb,
int collationType) |
Generate the code necessary to produce a SQL null of the appropriate
type.
|
int |
getCastToCharWidth(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 |
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.
|
DataTypeDescriptor |
resolveArithmeticOperation(DataTypeDescriptor leftType,
DataTypeDescriptor rightType,
java.lang.String operator) |
Type resolution methods on binary operators
|
boolean |
storable(TypeId otherType,
ClassFactory cf) |
Determine if this type can have a value of another type stored into it.
|
static final int LONGINT_MAXWIDTH_AS_CHAR
static final int INT_MAXWIDTH_AS_CHAR
static final int SMALLINT_MAXWIDTH_AS_CHAR
static final int TINYINT_MAXWIDTH_AS_CHAR
static final int DOUBLE_MAXWIDTH_AS_CHAR
static final int REAL_MAXWIDTH_AS_CHAR
static final int DEFAULT_DECIMAL_PRECISION
static final int DEFAULT_DECIMAL_SCALE
static final int MAX_DECIMAL_PRECISION_SCALE
static final int BOOLEAN_MAXWIDTH_AS_CHAR
static final java.lang.String PLUS_OP
static final java.lang.String DIVIDE_OP
static final java.lang.String MINUS_OP
static final java.lang.String TIMES_OP
static final java.lang.String SUM_OP
static final java.lang.String AVG_OP
static final java.lang.String MOD_OP
DataTypeDescriptor resolveArithmeticOperation(DataTypeDescriptor leftType, DataTypeDescriptor rightType, java.lang.String operator) throws StandardException
leftType
- The type of the left parameterrightType
- The type of the right parameteroperator
- The name of the operator (e.g. "+").StandardException
- Thrown on errorboolean convertible(TypeId otherType, boolean forDataTypeFunction)
otherType
- The CompilationType of the other type to compare
this type toforDataTypeFunction
- true if this is a type function that
requires more liberal behavior (e.g DOUBLE can convert a char but
you cannot cast a CHAR to double.boolean compatible(TypeId otherType)
otherType
- The CompilationType of the other type to compare
this type toboolean storable(TypeId otherType, ClassFactory cf)
otherType
- The TypeId of the other type to compare this type tocf
- A ClassFactoryjava.lang.String interfaceName()
java.lang.String getCorrespondingPrimitiveTypeName()
java.lang.String getPrimitiveMethodName()
void generateNull(MethodBuilder mb, int collationType)
mb
- The method to put the expression incollationType
- For character DVDs, this will be used to determine
what Collator should be associated with the DVD which in turn will
decide whether to generate CollatorSQLcharDVDs or SQLcharDVDs.void generateDataValue(MethodBuilder mb, int collationType, LocalField field)
mb
- The method to put the expression incollationType
- For character DVDs, this will be used to determine
what Collator should be associated with the DVD which in turn will
decide whether to generate CollatorSQLcharDVDs or SQLcharDVDs. For
other types of DVDs, this parameter will be ignored.field
- LocalFieldint getCastToCharWidth(DataTypeDescriptor dts)
dts
- The associated DataTypeDescriptor for this TypeId.Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.