public enum DataType extends Enum<DataType>
| Modifier and Type | Class and Description |
|---|---|
static class |
DataType.SqlTypeWithPostfix
Pair of SqlType and its name postfix.
|
| Enum Constant and Description |
|---|
APPLICATION
Application specific type.
Such types are immutable because they just convert data between internal and external representation. |
BIGDECIMAL
A
BigDecimal. |
BINARY
A
Binary (tentackle type). |
BMONEY
A
BMoney (tentackle type). |
BOOLEAN
A
Boolean. |
BOOLEAN_PRIMITIVE
A boolean (primitive).
|
BYTE
A
Byte. |
BYTE_PRIMITIVE
A byte (primitive).
|
CHARACTER
A
Character. |
CHARACTER_PRIMITIVE
A char (primitive).
|
DATE
A
Date. |
DMONEY
A
DMoney (tentackle type). |
DOUBLE
A
Double. |
DOUBLE_PRIMITIVE
A double (primitive).
|
FLOAT
A
Float. |
FLOAT_PRIMITIVE
A float (primitive).
|
INTEGER
A
Integer. |
INTEGER_PRIMITIVE
An int (primitive).
|
LONG
A
Long. |
LONG_PRIMITIVE
A long (primitive).
|
SHORT
A
Short. |
SHORT_PRIMITIVE
A short (primitive).
|
STRING
A
String. |
TIME
A
Time. |
TIMESTAMP
A
Timestamp. |
| Modifier and Type | Method and Description |
|---|---|
static DataType |
createFromJavaType(String javaType)
Creates a datatype from a java type string.
|
SqlType[] |
getSqlTypes()
Gets the sql type.
Notice that a tentackle type may be mapped to more than one column for multi-column types such as BMoney. |
DataType.SqlTypeWithPostfix[] |
getSqlTypesWithPostfix()
Gets the SqlTypes along with their column name postfixes.
|
boolean |
isBool()
Returns whether this is a boolean or Boolean type.
|
boolean |
isDateOrTime()
Returns whether this is a date and/or time type.
|
boolean |
isMultiColumn()
True if this is a multicolumn type.
|
boolean |
isMutable()
Returns whether type is a mutable java object.
Mutable objects may change their state. |
boolean |
isNumeric()
Returns whether this is a numeric type.
|
boolean |
isPrimitive()
Returns whether type is a primitive.
|
boolean |
isScaleInSecondColumn()
Returns whether this is a numeric type with the scale stored in a second column.
|
Object |
parse(String str)
Parses a string and converts to the value of this type.
|
DataType |
toNonPrimitive()
Converts a primitive to a Java class.
|
DataType |
toPrimitive()
Converts to a Java primitive.
|
String |
toString() |
static DataType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DataType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DataType BINARY
Binary (tentackle type).public static final DataType BIGDECIMAL
BigDecimal.public static final DataType BMONEY
BMoney (tentackle type).public static final DataType DMONEY
DMoney (tentackle type).public static final DataType CHARACTER_PRIMITIVE
public static final DataType BOOLEAN_PRIMITIVE
public static final DataType BYTE_PRIMITIVE
public static final DataType SHORT_PRIMITIVE
public static final DataType INTEGER_PRIMITIVE
public static final DataType LONG_PRIMITIVE
public static final DataType FLOAT_PRIMITIVE
public static final DataType DOUBLE_PRIMITIVE
public static final DataType APPLICATION
public static DataType[] values()
for (DataType c : DataType.values()) System.out.println(c);
public static DataType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic boolean isPrimitive()
public boolean isMutable()
public boolean isNumeric()
public boolean isDateOrTime()
public boolean isBool()
public SqlType[] getSqlTypes()
public DataType.SqlTypeWithPostfix[] getSqlTypesWithPostfix()
The first postfix is always the empty string. The second one is "_2", third "_3" and so on. This is a tentackle convention for multi-column types such as BMoney.
public boolean isMultiColumn()
public boolean isScaleInSecondColumn()
BMoney and Dmoney for example.
public DataType toPrimitive()
public DataType toNonPrimitive()
public Object parse(String str)
Notice: the method doesn't use any locale, so the results are always the same regardless of the JVM's locale.
str - the source stringCopyright © 2016 Krake Softwaretechnik. All rights reserved.