public enum DataType extends Enum<DataType>
DataPersister
.Enum Constant and Description |
---|
BIG_DECIMAL
Persists the
BigDecimal Java class as a String. |
BIG_DECIMAL_NUMERIC
Persists the
BigDecimal Java class as a SQL NUMERIC. |
BIG_INTEGER
Persists the
BigInteger Java class. |
BOOLEAN
Persists the boolean Java primitive.
|
BOOLEAN_CHAR
Persists the boolean Java primitive as a character in the database.
|
BOOLEAN_INTEGER
Persists the boolean Java primitive as an integer in the database.
|
BOOLEAN_OBJ
Persists the
Boolean object Java class. |
BYTE |
BYTE_ARRAY
Persists the byte[] array type.
|
BYTE_OBJ
Persists the
Byte object Java class. |
CHAR
Persists the char primitive.
|
CHAR_OBJ
Persists the
Character object Java class. |
CURRENCY
Persists the
Currency Java class. |
DATE
Persists the
Date Java class. |
DATE_INTEGER
Persists the
Date Java class as int seconds since epoch. |
DATE_LONG
Persists the
Date Java class as long milliseconds since epoch. |
DATE_STRING
Persists the
Date Java class as a string of a format. |
DATE_TIME
Persists the org.joda.time.DateTime type as a long integer.
|
DOUBLE
Persists the double primitive.
|
DOUBLE_OBJ
Persists the
Double object Java class. |
ENUM_INTEGER
Persists an Enum Java class as its ordinal integer value.
|
ENUM_NAME
Persists an Enum Java class as its name produced by call @{link
Enum.name() . |
ENUM_STRING
See
ENUM_NAME |
ENUM_TO_STRING
Persists an Enum Java class as its string value produced by call @{link
Enum.toString() . |
FLOAT
Persists the float primitive.
|
FLOAT_OBJ
Persists the
Float object Java class. |
INTEGER
Persists the int primitive.
|
INTEGER_OBJ
Persists the
Integer object Java class. |
LONG
Persists the long primitive.
|
LONG_OBJ
Persists the
Long object Java class. |
LONG_STRING
Persists the
String Java class. |
SERIALIZABLE
Persists an unknown Java Object that is serializable.
|
SHORT
Persists the short primitive.
|
SHORT_OBJ
Persists the
Short object Java class. |
SQL_DATE
Persists the
Date Java class. |
STRING
Persists the
String Java class. |
STRING_BYTES
Persists the
String Java class as an array of bytes. |
TIME_STAMP
Persists the
Timestamp Java class. |
TIME_STAMP_STRING
Persists the
Timestamp Java class as a string of a format. |
UNKNOWN
Marker for fields that are unknown.
|
UUID
Persists the
UUID Java class. |
UUID_NATIVE
Persists the
UUID Java class as a native UUID column which is only supported by a couple of
database types. |
Modifier and Type | Method and Description |
---|---|
DataPersister |
getDataPersister() |
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 STRING_BYTES
String
Java class as an array of bytes. By default this will use STRING
so you will
need to specify this using DatabaseField.dataType()
.public static final DataType BOOLEAN
public static final DataType BOOLEAN_CHAR
public static final DataType BOOLEAN_INTEGER
public static final DataType BYTE
public static final DataType BYTE_ARRAY
DatabaseField.dataType()
. It won't be detected automatically.public static final DataType CHAR
public static final DataType SHORT
public static final DataType INTEGER
public static final DataType LONG
public static final DataType FLOAT
public static final DataType DOUBLE
public static final DataType SERIALIZABLE
DatabaseField.dataType()
. It won't be detected
automatically.public static final DataType ENUM_NAME
Enum.name()
. You can also specify the
ENUM_INTEGER
or ENUM_TO_STRING
as the type.public static final DataType ENUM_TO_STRING
Enum.toString()
. You can also
specify the ENUM_INTEGER
or ENUM_STRING
as the type.public static final DataType ENUM_INTEGER
ENUM_STRING
or
ENUM_TO_STRING
as the type.public static final DataType UUID_NATIVE
UUID
Java class as a native UUID column which is only supported by a couple of
database types.public static final DataType BIG_INTEGER
BigInteger
Java class.public static final DataType BIG_DECIMAL
BigDecimal
Java class as a String.public static final DataType BIG_DECIMAL_NUMERIC
BigDecimal
Java class as a SQL NUMERIC.public static final DataType DATE
public static final DataType DATE_LONG
Date
Java class as long milliseconds since epoch. By default this will use
DATE
so you will need to specify this using DatabaseField.dataType()
.
NOTE: This is not the same as the Date
class.
public static final DataType DATE_INTEGER
Date
Java class as int seconds since epoch. By default this will use DATE
so you will need to specify this using DatabaseField.dataType()
.
NOTE: This is not the same as the Date
class.
public static final DataType DATE_STRING
Date
Java class as a string of a format. By default this will use DATE
so
you will need to specify this using DatabaseField.dataType()
.
NOTE: This is not the same as the Date
class.
WARNING: Because of SimpleDateFormat not being reentrant, this has to do some synchronization with every data in/out unfortunately.
public static final DataType DATE_TIME
DatabaseField.dataType()
. It won't be
detected automatically.public static final DataType SQL_DATE
public static final DataType TIME_STAMP_STRING
Timestamp
Java class as a string of a format.public static final DataType UNKNOWN
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 DataPersister getDataPersister()
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.