org.apache.empire.data
Enum DataType

java.lang.Object
  extended by java.lang.Enum<DataType>
      extended by org.apache.empire.data.DataType
All Implemented Interfaces:
Serializable, Comparable<DataType>

public enum DataType
extends Enum<DataType>

DataType is an enumeration of data types that are supported with the empire-db component.


Enum Constant Summary
AUTOINC
          A numeric sequence generated value
BLOB
          Binary data
BOOL
          Boolean field (emulated if not supported by DBMS as number or char)
CHAR
          Fixed length character value.
CLOB
          Long text > 2K
DATE
          Date only value (without time)
DATETIME
          Date value including time.
DECIMAL
          Decimal numeric value (size indicates scale and precision)
FLOAT
          floating point value
INTEGER
          Integer value (16, 32 or 64 bit)
TEXT
          Small text (represents varchar)
UNIQUEID
          Unique Identifier (non-numeric, treated like text)
UNKNOWN
          Unknown, used internally only for sql phrases
 
Method Summary
 boolean isBoolean()
          Returns true if the data type is a boolean type
 boolean isDate()
          Returns true if the data type is a date based data type (date or datetime)
 boolean isNumeric()
          Returns true if the data type is a numeric data type (integer, decimal, float)
 boolean isText()
          Returns true if the data type is a text based data type (char, text or clob)
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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UNKNOWN

public static final DataType UNKNOWN
Unknown, used internally only for sql phrases


INTEGER

public static final DataType INTEGER
Integer value (16, 32 or 64 bit)


AUTOINC

public static final DataType AUTOINC
A numeric sequence generated value


TEXT

public static final DataType TEXT
Small text (represents varchar)


DATE

public static final DataType DATE
Date only value (without time)


DATETIME

public static final DataType DATETIME
Date value including time. Also knows a timestamp


CHAR

public static final DataType CHAR
Fixed length character value.


FLOAT

public static final DataType FLOAT
floating point value


DECIMAL

public static final DataType DECIMAL
Decimal numeric value (size indicates scale and precision)


BOOL

public static final DataType BOOL
Boolean field (emulated if not supported by DBMS as number or char)


CLOB

public static final DataType CLOB
Long text > 2K


BLOB

public static final DataType BLOB
Binary data


UNIQUEID

public static final DataType UNIQUEID
Unique Identifier (non-numeric, treated like text)

Method Detail

values

public static DataType[] 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 (DataType c : DataType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DataType valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

isText

public boolean isText()
Returns true if the data type is a text based data type (char, text or clob)

Returns:
true if the data type is a character based data type

isNumeric

public boolean isNumeric()
Returns true if the data type is a numeric data type (integer, decimal, float)

Returns:
true if the data type is a numeric data type

isDate

public boolean isDate()
Returns true if the data type is a date based data type (date or datetime)

Returns:
true if the data type is a date based data type

isBoolean

public boolean isBoolean()
Returns true if the data type is a boolean type

Returns:
true if the data type is a boolean type


Copyright © 2008–2014 Apache Software Foundation. All rights reserved.