- java.lang.Object
-
- java.lang.Enum<SqlType>
-
- org.tentackle.sql.SqlType
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BIGINTLong and long.BITBoolean and boolean.BLOBArbitrary data usually stored as BLOB.CHARCharacter and char.CLOBLarge Strings usually stored as CLOB.DATEDate.DECIMALBigDecimal and DMoney.DOUBLEDouble and double.FLOATFloat and float.INTEGERInteger and int.JAVA_OBJECTApplication specific.SMALLINTShort and short.TIMETime.TIMESTAMPTimestamp.TINYINTByte and byte.VARCHARString.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetDefaultValue()Gets the default value.booleanisFractional()Returns whether numeric fractional type.booleanisNumeric()Returns whether numeric type.java.lang.Objectparse(java.lang.String str)Parses the string and converts to a java-value.static SqlTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static SqlType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
VARCHAR
public static final SqlType VARCHAR
String.
-
DATE
public static final SqlType DATE
Date.
-
TIME
public static final SqlType TIME
Time.
-
TIMESTAMP
public static final SqlType TIMESTAMP
Timestamp.
-
BLOB
public static final SqlType BLOB
Arbitrary data usually stored as BLOB.
-
CLOB
public static final SqlType CLOB
Large Strings usually stored as CLOB.
-
DECIMAL
public static final SqlType DECIMAL
BigDecimal and DMoney.
-
CHAR
public static final SqlType CHAR
Character and char.
-
BIT
public static final SqlType BIT
Boolean and boolean.
-
TINYINT
public static final SqlType TINYINT
Byte and byte.
-
SMALLINT
public static final SqlType SMALLINT
Short and short.
-
INTEGER
public static final SqlType INTEGER
Integer and int.
-
BIGINT
public static final SqlType BIGINT
Long and long.
-
FLOAT
public static final SqlType FLOAT
Float and float.
-
DOUBLE
public static final SqlType DOUBLE
Double and double.
-
JAVA_OBJECT
public static final SqlType JAVA_OBJECT
Application specific.
-
-
Method Detail
-
values
public static SqlType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SqlType c : SqlType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SqlType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
isNumeric
public boolean isNumeric()
Returns whether numeric type.- Returns:
- true if numeric
-
isFractional
public boolean isFractional()
Returns whether numeric fractional type.- Returns:
- true if fractional
-
getDefaultValue
public java.lang.Object getDefaultValue()
Gets the default value.- Returns:
- the default, null if no default
-
parse
public java.lang.Object parse(java.lang.String str)
Parses the string and converts to a java-value.- Parameters:
str- the string usually returned from JDBC metadata- Returns:
- the java value
-
-