org.eclipse.datatools.sqltools.parsers.sql.query
Interface SQLQueryParserFactoryDataTypes

All Known Implementing Classes:
SQLQueryParserFactory, SQLXMLQueryParserFactory

public interface SQLQueryParserFactoryDataTypes

This interface defines methods and constants needed to construct PredefinedDataTypes. TODO: should we enforce restrictions here on values for length, precision, ...

Author:
ckadner

Field Summary
static int PRIMITIVE_TYPE_BIGINT
          The 'BIGINT' PrimitiveType constant.
static int PRIMITIVE_TYPE_BINARY
          The 'BINARY' PrimitiveType constant.
static int PRIMITIVE_TYPE_BINARY_LARGE_OBJECT
          The 'BINARY LARGE OBJECT' PrimitiveType constant.
static int PRIMITIVE_TYPE_BINARY_VARYING
          The 'BINARY VARYING' PrimitiveType constant.
static int PRIMITIVE_TYPE_BOOLEAN
          The 'BOOLEAN' PrimitiveType constant.
static int PRIMITIVE_TYPE_CHARACTER
          The 'CHARACTER' PrimitiveType constant.
static int PRIMITIVE_TYPE_CHARACTER_LARGE_OBJECT
          The 'CHARACTER LARGE OBJECT' PrimitiveType constant.
static int PRIMITIVE_TYPE_CHARACTER_VARYING
          The 'CHARACTER VARYING' PrimitiveType constant.
static int PRIMITIVE_TYPE_DATALINK
          The 'DATALINK' PrimitiveType constant.
static int PRIMITIVE_TYPE_DATE
          The 'DATE' PrimitiveType constant.
static int PRIMITIVE_TYPE_DECIMAL
          The 'DECIMAL' PrimitiveType constant.
static int PRIMITIVE_TYPE_DOUBLE_PRECISION
          The 'DOUBLE PRECISION' PrimitiveType constant.
static int PRIMITIVE_TYPE_FLOAT
          The 'FLOAT' PrimitiveType constant.
static int PRIMITIVE_TYPE_INTEGER
          The 'INTEGER' PrimitiveType constant.
static int PRIMITIVE_TYPE_INTERVAL
          The 'INTERVAL' PrimitiveType constant.
static int PRIMITIVE_TYPE_NATIONAL_CHARACTER
          The 'NATIONAL CHARACTER' PrimitiveType constant.
static int PRIMITIVE_TYPE_NATIONAL_CHARACTER_LARGE_OBJECT
          The 'NATIONAL CHARACTER LARGE OBJECT' PrimitiveType constant.
static int PRIMITIVE_TYPE_NATIONAL_CHARACTER_VARYING
          The 'NATIONAL CHARACTER VARYING' PrimitiveType constant.
static int PRIMITIVE_TYPE_NUMERIC
          The 'NUMERIC' PrimitiveType constant.
static int PRIMITIVE_TYPE_REAL
          The 'REAL' PrimitiveType constant.
static int PRIMITIVE_TYPE_SMALLINT
          The 'SMALLINT' PrimitiveType constant.
static int PRIMITIVE_TYPE_TIME
          The 'TIME' PrimitiveType constant.
static int PRIMITIVE_TYPE_TIMESTAMP
          The 'TIMESTAMP' PrimitiveType constant.
static java.lang.String UNIT_INDICATOR_G
          The one character String constant 'G' representing the unit Gigabyte.
static java.lang.String UNIT_INDICATOR_K
          The one character String constant 'K' representing the unit Kilobyte.
static java.lang.String UNIT_INDICATOR_M
          The one character String constant 'M' representing the unit Megabyte.
 
Method Summary
 ArrayDataType createDataTypeArray(DataType elementDataType)
          Factory method to construct a ArrayDataType with the element data type elementDataType.
 ArrayDataType createDataTypeArray(DataType elementDataType, int maxCardinality)
          Factory method to construct a ArrayDataType with the element data type elementDataType and with maximum cardinality specified by maxCardinality.
 BinaryStringDataType createDataTypeBinaryString(int primitiveType, int length, java.lang.String optionalUnitsIndicator)
          Factory method to construct a BinaryStringDataType with its primitiveType and length.
 BooleanDataType createDataTypeBoolean()
          Factory method to construct a BooleanDataType with primitiveType PrimitiveType.BOOLEAN_LITERAL.
 CharacterStringDataType createDataTypeCharacterString(int primitiveType, int length, java.lang.String optionalUnitsIndicator)
          Factory method to construct a CharacterStringDataType with its primitiveType and length.
 DataLinkDataType createDataTypeDataLink(int length)
          TODO: finish method signature and doc properly!
 DateDataType createDataTypeDate()
          Factory method to construct a DateDataType with primitiveType PrimitiveType.DATE_LITERAL.
 IntervalDataType createDataTypeInterval(IntervalQualifierType leadingQualifier, IntervalQualifierType trailingQualifier, int leadingFieldPrecision, int trailingFieldPrecision, int fractionalSecondsPrecision)
          Factory method to construct a IntervalDataType with primitiveType PrimitiveType.INTERVAL.
 MultisetDataType createDataTypeMultiset(DataType elementDataType)
          Factory method to construct a MultisetDataType with the element data type elementDataType.
 ApproximateNumericDataType createDataTypeNumericApproximate(int primitiveType, int precision)
          Factory method to construct a ApproximateNumericDataType with its primitiveType and precision.
 FixedPrecisionDataType createDataTypeNumericFixedPrecision(int primitiveType, int precision, int scale)
          Factory method to construct a FixedPrecisionDataType with its primitiveType, precision and scale.
 IntegerDataType createDataTypeNumericInteger(int primitiveType, int precision)
          Factory method to construct a IntegerDataType with its primitiveType.
 TimeDataType createDataTypeTime(int primitiveType, int fractionalSecondsPrecision)
          Factory method to construct a TimeDataType with its primitiveType and length.
 

Field Detail

PRIMITIVE_TYPE_CHARACTER

static final int PRIMITIVE_TYPE_CHARACTER
The 'CHARACTER' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#CHARACTER, Constant Field Values

PRIMITIVE_TYPE_CHARACTER_VARYING

static final int PRIMITIVE_TYPE_CHARACTER_VARYING
The 'CHARACTER VARYING' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#CHARACTER_VARYING, Constant Field Values

PRIMITIVE_TYPE_CHARACTER_LARGE_OBJECT

static final int PRIMITIVE_TYPE_CHARACTER_LARGE_OBJECT
The 'CHARACTER LARGE OBJECT' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#CHARACTER_LARGE_OBJECT, Constant Field Values

PRIMITIVE_TYPE_NATIONAL_CHARACTER

static final int PRIMITIVE_TYPE_NATIONAL_CHARACTER
The 'NATIONAL CHARACTER' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#NATIONAL_CHARACTER, Constant Field Values

PRIMITIVE_TYPE_NATIONAL_CHARACTER_VARYING

static final int PRIMITIVE_TYPE_NATIONAL_CHARACTER_VARYING
The 'NATIONAL CHARACTER VARYING' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#NATIONAL_CHARACTER_VARYING, Constant Field Values

PRIMITIVE_TYPE_NATIONAL_CHARACTER_LARGE_OBJECT

static final int PRIMITIVE_TYPE_NATIONAL_CHARACTER_LARGE_OBJECT
The 'NATIONAL CHARACTER LARGE OBJECT' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#NATIONAL_CHARACTER_LARGE_OBJECT, Constant Field Values

PRIMITIVE_TYPE_BINARY

static final int PRIMITIVE_TYPE_BINARY
The 'BINARY' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#BINARY, Constant Field Values

PRIMITIVE_TYPE_BINARY_VARYING

static final int PRIMITIVE_TYPE_BINARY_VARYING
The 'BINARY VARYING' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#BINARY_VARYING, Constant Field Values

PRIMITIVE_TYPE_BINARY_LARGE_OBJECT

static final int PRIMITIVE_TYPE_BINARY_LARGE_OBJECT
The 'BINARY LARGE OBJECT' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#BINARY_LARGE_OBJECT, Constant Field Values

PRIMITIVE_TYPE_NUMERIC

static final int PRIMITIVE_TYPE_NUMERIC
The 'NUMERIC' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#NUMERIC, Constant Field Values

PRIMITIVE_TYPE_DECIMAL

static final int PRIMITIVE_TYPE_DECIMAL
The 'DECIMAL' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#DECIMAL, Constant Field Values

PRIMITIVE_TYPE_SMALLINT

static final int PRIMITIVE_TYPE_SMALLINT
The 'SMALLINT' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#SMALLINT, Constant Field Values

PRIMITIVE_TYPE_INTEGER

static final int PRIMITIVE_TYPE_INTEGER
The 'INTEGER' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#INTEGER, Constant Field Values

PRIMITIVE_TYPE_BIGINT

static final int PRIMITIVE_TYPE_BIGINT
The 'BIGINT' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#BIGINT, Constant Field Values

PRIMITIVE_TYPE_FLOAT

static final int PRIMITIVE_TYPE_FLOAT
The 'FLOAT' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#FLOAT, Constant Field Values

PRIMITIVE_TYPE_REAL

static final int PRIMITIVE_TYPE_REAL
The 'REAL' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#REAL, Constant Field Values

PRIMITIVE_TYPE_DOUBLE_PRECISION

static final int PRIMITIVE_TYPE_DOUBLE_PRECISION
The 'DOUBLE PRECISION' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#DOUBLE_PRECISION, Constant Field Values

PRIMITIVE_TYPE_BOOLEAN

static final int PRIMITIVE_TYPE_BOOLEAN
The 'BOOLEAN' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#BOOLEAN, Constant Field Values

PRIMITIVE_TYPE_DATE

static final int PRIMITIVE_TYPE_DATE
The 'DATE' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#DATE, Constant Field Values

PRIMITIVE_TYPE_TIME

static final int PRIMITIVE_TYPE_TIME
The 'TIME' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#TIME, Constant Field Values

PRIMITIVE_TYPE_TIMESTAMP

static final int PRIMITIVE_TYPE_TIMESTAMP
The 'TIMESTAMP' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#TIMESTAMP, Constant Field Values

PRIMITIVE_TYPE_INTERVAL

static final int PRIMITIVE_TYPE_INTERVAL
The 'INTERVAL' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#INTERVAL, Constant Field Values

PRIMITIVE_TYPE_DATALINK

static final int PRIMITIVE_TYPE_DATALINK
The 'DATALINK' PrimitiveType constant.

See Also:
org.eclipse.wst.rdb.internal.models.sql.datatypes.PrimitiveType#DATALINK, Constant Field Values

UNIT_INDICATOR_K

static final java.lang.String UNIT_INDICATOR_K
The one character String constant 'K' representing the unit Kilobyte.

See Also:
Constant Field Values

UNIT_INDICATOR_M

static final java.lang.String UNIT_INDICATOR_M
The one character String constant 'M' representing the unit Megabyte.

See Also:
Constant Field Values

UNIT_INDICATOR_G

static final java.lang.String UNIT_INDICATOR_G
The one character String constant 'G' representing the unit Gigabyte.

See Also:
Constant Field Values
Method Detail

createDataTypeArray

ArrayDataType createDataTypeArray(DataType elementDataType)
Factory method to construct a ArrayDataType with the element data type elementDataType.

Parameters:
elementDataType -
Returns:
the newly constructed ArrayDataType

createDataTypeArray

ArrayDataType createDataTypeArray(DataType elementDataType,
                                  int maxCardinality)
Factory method to construct a ArrayDataType with the element data type elementDataType and with maximum cardinality specified by maxCardinality.

Parameters:
elementDataType -
maxCardinality -
Returns:
the newly constructed ArrayDataType

createDataTypeCharacterString

CharacterStringDataType createDataTypeCharacterString(int primitiveType,
                                                      int length,
                                                      java.lang.String optionalUnitsIndicator)
Factory method to construct a CharacterStringDataType with its primitiveType and length.

Note: The optional parameter optionalUnitsIndicator may only be specified with the given primitiveType PRIMITIVE_TYPE_CHARACTER_LARGE_OBJECTor PRIMITIVE_TYPE_NATIONAL_CHARACTER_LARGE_OBJECT, where UNIT_INDICATOR_Kmeasures the given length in Kilobyte (for the given length<= 2097152), UNIT_INDICATOR_Mmeasures the given length in Megabyte (for the given length<= 2048), UNIT_INDICATOR_Gmeasures the given length in Gigabyte (for the given length<= 2).

Note: The given primitiveType must be one of the constants for the primitve types in this interface/class correlated to the CharacterStringDataType.

Parameters:
primitiveType - one of the correlated the primitive types for the CharacterStringDataType
length - the length of this CharacterStringDataType
optionalUnitsIndicator - optional parameter indicating the given length is measured in Kilobyte (use UNIT_INDICATOR_K), Megabyte (use UNIT_INDICATOR_M) or Gigabyte (use UNIT_INDICATOR_G)
Returns:
the newly constructed CharacterStringDataType
See Also:
PRIMITIVE_TYPE_CHARACTER, PRIMITIVE_TYPE_CHARACTER_VARYING, PRIMITIVE_TYPE_CHARACTER_LARGE_OBJECT, PRIMITIVE_TYPE_NATIONAL_CHARACTER, PRIMITIVE_TYPE_NATIONAL_CHARACTER_VARYING, PRIMITIVE_TYPE_NATIONAL_CHARACTER_LARGE_OBJECT

createDataTypeBoolean

BooleanDataType createDataTypeBoolean()
Factory method to construct a BooleanDataType with primitiveType PrimitiveType.BOOLEAN_LITERAL.

Returns:
the newly constructed BooleanDataType

createDataTypeBinaryString

BinaryStringDataType createDataTypeBinaryString(int primitiveType,
                                                int length,
                                                java.lang.String optionalUnitsIndicator)
Factory method to construct a BinaryStringDataType with its primitiveType and length.

Note: The optional parameter optionalUnitsIndicator may only be specified with the given primitiveType PRIMITIVE_TYPE_BINARY_LARGE_OBJECT, where UNIT_INDICATOR_K measures the given length in Kilobyte (for the given length <= 2097152), UNIT_INDICATOR_M measures the given length in Megabyte (for the given length <= 2048), UNIT_INDICATOR_G measures the given length in Gigabyte (for the given length <= 2).

Note: The given primitiveType must be one of the constants for the primitve types in this interface/class correlated to the BinaryStringDataType.

Parameters:
primitiveType - one of the correlated the primitive types for the BinaryStringDataType
length - the length of this BinaryStringDataType
optionalUnitsIndicator - optional parameter indicating the given length is measured in Kilobyte (use UNIT_INDICATOR_K), Megabyte (use UNIT_INDICATOR_M) or Gigabyte (use UNIT_INDICATOR_G)
Returns:
the newly constructed BinaryStringDataType
See Also:
PRIMITIVE_TYPE_BINARY, PRIMITIVE_TYPE_BINARY_VARYING, PRIMITIVE_TYPE_BINARY_LARGE_OBJECT

createDataTypeDataLink

DataLinkDataType createDataTypeDataLink(int length)
TODO: finish method signature and doc properly!

Parameters:
length -
Returns:

createDataTypeInterval

IntervalDataType createDataTypeInterval(IntervalQualifierType leadingQualifier,
                                        IntervalQualifierType trailingQualifier,
                                        int leadingFieldPrecision,
                                        int trailingFieldPrecision,
                                        int fractionalSecondsPrecision)
Factory method to construct a IntervalDataType with primitiveType PrimitiveType.INTERVAL.

Parameters:
leadingQualifier -
trailingQualifier -
leadingFieldPrecision -
trailingFieldPrecision -
fractionalSecondsPrecision -
Returns:

createDataTypeTime

TimeDataType createDataTypeTime(int primitiveType,
                                int fractionalSecondsPrecision)
Factory method to construct a TimeDataType with its primitiveType and length.

Note: The given primitiveType must be one of the constants for the primitve types in this interface/class correlated to the TimeDataType.

Parameters:
primitiveType - one of the correlated the primitive types for the TimeDataType PRIMITIVE_TYPE_TIME, PRIMITIVE_TYPE_TIMESTAMP
fractionalSecondsPrecision - optional precision in fractional seconds of this TimeDataType (TimeDataType.setFractionalSecondsPrecision(int)), if not specified default value for given primitiveType PRIMITIVE_TYPE_TIME is 0 and for PRIMITIVE_TYPE_TIMESTAMP is 6
Returns:
the newly constructed TimeDataType
See Also:
PRIMITIVE_TYPE_TIME,

Note: If the optional parameter fractionalSecondsPrecision is not specified, the default value for the given primitiveType {@link #PRIMITIVE_TYPE_TIME} is 0 and for primitiveType {@link #PRIMITIVE_TYPE_TIMESTAMP} is 6.


createDataTypeDate

DateDataType createDataTypeDate()
Factory method to construct a DateDataType with primitiveType PrimitiveType.DATE_LITERAL.

Returns:
the newly constructed DateDataType
See Also:
PRIMITIVE_TYPE_DATE

createDataTypeMultiset

MultisetDataType createDataTypeMultiset(DataType elementDataType)
Factory method to construct a MultisetDataType with the element data type elementDataType.

Parameters:
elementDataType -
Returns:
the newly constructed MultisetDataType

createDataTypeNumericFixedPrecision

FixedPrecisionDataType createDataTypeNumericFixedPrecision(int primitiveType,
                                                           int precision,
                                                           int scale)
Factory method to construct a FixedPrecisionDataType with its primitiveType, precision and scale. Note: The given primitiveType must be one of the constants for the primitve types in this interface/class correlated to the FixedPrecisionDataType.

Parameters:
primitiveType - one of the correlated the primitive types for the FixedPrecisionDataType PRIMITIVE_TYPE_NUMERIC, PRIMITIVE_TYPE_DECIMAL
precision - the total number of digits org.eclipse.wst.rdb.internal.models.sql.datatypes.NumericalDataType#setPrecision(int) ranges between 1 and 31
scale - the number of digits to the right of the decimal point, ranges between 0 and precision org.eclipse.wst.rdb.internal.models.sql.datatypes.ExactNumericDataType#setScale(int)
Returns:
the newly constructed FixedPrecisionDataType
See Also:
PRIMITIVE_TYPE_NUMERIC, PRIMITIVE_TYPE_DECIMAL

createDataTypeNumericInteger

IntegerDataType createDataTypeNumericInteger(int primitiveType,
                                             int precision)
Factory method to construct a IntegerDataType with its primitiveType. The precision is implicitly given for the primitiveTypes PRIMITIVE_TYPE_SMALLINT (5) and PRIMITIVE_TYPE_INTEGER (10). The precision has to be explicitely specified for the primitiveType PRIMITIVE_TYPE_BIGINT or will be set to 10 by default. Note: The given primitiveType must be one of the constants for the primitve types in this interface/class correlated to the intDataType.

Parameters:
primitiveType - one of the correlated the primitive types for the intDataType PRIMITIVE_TYPE_SMALLINT precision is 5, PRIMITIVE_TYPE_INTEGER precision is 10, PRIMITIVE_TYPE_BIGINT precision has to be given, default is 10
precision - the total number of digits for given primitiveType PRIMITIVE_TYPE_BIGINT, default is 10 org.eclipse.wst.rdb.internal.models.sql.datatypes.NumericalDataType#setPrecision(int) ranges between 1 and 31
Returns:
the newly constructed intDataType
See Also:
PRIMITIVE_TYPE_SMALLINT, PRIMITIVE_TYPE_INTEGER, PRIMITIVE_TYPE_BIGINT

createDataTypeNumericApproximate

ApproximateNumericDataType createDataTypeNumericApproximate(int primitiveType,
                                                            int precision)
Factory method to construct a ApproximateNumericDataType with its primitiveType and precision. Note: The given primitiveType must be one of the constants for the primitve types in this interface/class correlated to the ApproximateNumericDataType.

Parameters:
primitiveType - one of the correlated the primitive types for the FixedPrecisionDataType PRIMITIVE_TYPE_FLOAT, PRIMITIVE_TYPE_REAL, PRIMITIVE_TYPE_DOUBLE_PRECISION
precision - the total number of digits org.eclipse.wst.rdb.internal.models.sql.datatypes.NumericalDataType#setPrecision(int) ranges between 1 and 31
Returns:
the newly constructed ApproximateNumericDataType
See Also:
PRIMITIVE_TYPE_FLOAT, PRIMITIVE_TYPE_REAL, PRIMITIVE_TYPE_DOUBLE_PRECISION