Enum ColumnType
- java.lang.Object
-
- java.lang.Enum<ColumnType>
-
- de.akquinet.jbosscc.guttenbase.meta.ColumnType
-
- All Implemented Interfaces:
Serializable,Comparable<ColumnType>
public enum ColumnType extends Enum<ColumnType>
Define column type and mapping methods© 2012-2034 akquinet tech@spree
- Author:
- M. Dahm
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CLASS_BIGDECIMALCLASS_BLOBCLASS_BOOLEANCLASS_BYTECLASS_BYTESCLASS_CLOBCLASS_DATECLASS_DOUBLECLASS_FLOATCLASS_INTEGERCLASS_LONGCLASS_OBJECTCLASS_SHORTCLASS_SQLXMLCLASS_STRINGCLASS_TIMECLASS_TIMESTAMPCLASS_UNKNOWN
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Class<?>>getColumnClasses()ObjectgetValue(ResultSet resultSet, int columnIndex)Get value fromResultSetbooleanisNumber()static booleanisSupportedClass(Class<?> columnClass)Check if class can be mapped toColumnType.static booleanisSupportedClass(String className)Check if class can be mapped toColumnType.CloseablesetValue(PreparedStatement insertStatement, int columnIndex, Object data, DatabaseType databaseType, int sqlType)Set value inPreparedStatementstatic ColumnTypevalueForClass(String className)static ColumnTypevalueOf(Class<?> columnClass)Map class toColumnType.static ColumnTypevalueOf(String name)Returns the enum constant of this type with the specified name.static ColumnType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CLASS_UNKNOWN
public static final ColumnType CLASS_UNKNOWN
-
CLASS_STRING
public static final ColumnType CLASS_STRING
-
CLASS_BIGDECIMAL
public static final ColumnType CLASS_BIGDECIMAL
-
CLASS_BLOB
public static final ColumnType CLASS_BLOB
-
CLASS_CLOB
public static final ColumnType CLASS_CLOB
-
CLASS_SQLXML
public static final ColumnType CLASS_SQLXML
-
CLASS_OBJECT
public static final ColumnType CLASS_OBJECT
-
CLASS_DATE
public static final ColumnType CLASS_DATE
-
CLASS_TIMESTAMP
public static final ColumnType CLASS_TIMESTAMP
-
CLASS_TIME
public static final ColumnType CLASS_TIME
-
CLASS_INTEGER
public static final ColumnType CLASS_INTEGER
-
CLASS_BOOLEAN
public static final ColumnType CLASS_BOOLEAN
-
CLASS_LONG
public static final ColumnType CLASS_LONG
-
CLASS_DOUBLE
public static final ColumnType CLASS_DOUBLE
-
CLASS_FLOAT
public static final ColumnType CLASS_FLOAT
-
CLASS_BYTE
public static final ColumnType CLASS_BYTE
-
CLASS_BYTES
public static final ColumnType CLASS_BYTES
-
CLASS_SHORT
public static final ColumnType CLASS_SHORT
-
-
Method Detail
-
values
public static ColumnType[] 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 (ColumnType c : ColumnType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ColumnType 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 nameNullPointerException- if the argument is null
-
getValue
public Object getValue(ResultSet resultSet, int columnIndex) throws SQLException
Get value fromResultSet- Throws:
SQLException
-
setValue
public Closeable setValue(PreparedStatement insertStatement, int columnIndex, Object data, DatabaseType databaseType, int sqlType) throws SQLException
Set value inPreparedStatement- Throws:
SQLException
-
valueOf
public static ColumnType valueOf(Class<?> columnClass)
Map class toColumnType.
-
isNumber
public boolean isNumber()
-
isSupportedClass
public static boolean isSupportedClass(Class<?> columnClass)
Check if class can be mapped toColumnType.
-
isSupportedClass
public static boolean isSupportedClass(String className)
Check if class can be mapped toColumnType.
-
valueForClass
public static ColumnType valueForClass(String className)
-
-