There are several methods for creating literals in {@link RexBuilder}: {@link RexBuilder#makeLiteral(boolean)} and so forth.
How is the value stored? In that respect, the class is somewhat of a black box. There is a {@link #getValue} method which returns the value as anobject, but the type of that value is implementation detail, and it is best that your code does not depend upon that knowledge. It is better to use task-oriented methods such as {@link #getValue2} and{@link #toJavaString}.
The allowable types and combinations are:
TypeName | Meaing | Value type |
---|---|---|
{@link SqlTypeName#NULL} | The null value. It has its own special type. | null |
{@link SqlTypeName#BOOLEAN} | Boolean, namely TRUE , FALSE or UNKNOWN . | {@link Boolean}, or null represents the UNKNOWN value |
{@link SqlTypeName#DECIMAL} | Exact number, for example 0 , -.5 , 12345 . | {@link BigDecimal} |
{@link SqlTypeName#DOUBLE} | Approximate number, for example 6.023E-23 . | {@link BigDecimal} |
{@link SqlTypeName#DATE} | Date, for example DATE '1969-04'29' | {@link Calendar} |
{@link SqlTypeName#TIME} | Time, for example TIME '18:37:42.567' | {@link Calendar} |
{@link SqlTypeName#TIMESTAMP} | Timestamp, for example TIMESTAMP '1969-04-29 18:37:42.567' | {@link Calendar} |
{@link SqlTypeName#CHAR} | Character constant, for example 'Hello, world!' , '' , _N'Bonjour' , _ISO-8859-1'It''s superman!' COLLATE SHIFT_JIS$ja_JP$2 . These are always CHAR, never VARCHAR. | {@link NlsString} |
{@link SqlTypeName#BINARY} | Binary constant, for example X'7F34' . (The number of hexits must be even; see above.) These constants are always BINARY, never VARBINARY. | {@link ByteBuffer} |
{@link SqlTypeName#SYMBOL} | A symbol is a special type used to make parsing easier; it is not part of the SQL standard, and is not exposed to end-users. It is used to hold a flag, such as the LEADING flag in a call to the function TRIM([LEADING|TRAILING|BOTH] chars FROM string) . | An enum class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|