org.mentabean.type
Class EnumIdType
java.lang.Object
org.mentabean.type.EnumIdType
- All Implemented Interfaces:
- DBType<Enum<?>>
public class EnumIdType
- extends Object
- implements DBType<Enum<?>>
EnumIdType
public EnumIdType(Class<? extends Enum<?>> enumType)
canBeNull
public boolean canBeNull()
- Specified by:
canBeNull in interface DBType<Enum<?>>
nullable
public EnumIdType nullable(boolean flag)
getAnsiType
public String getAnsiType()
- Specified by:
getAnsiType in interface DBType<Enum<?>>
toString
public String toString()
- Overrides:
toString in class Object
getFromResultSet
public Enum<?> getFromResultSet(ResultSet rset,
int index)
throws SQLException
- Description copied from interface:
DBType
- Do what you have to do to get and return this database type from a result set.
- Specified by:
getFromResultSet in interface DBType<Enum<?>>
- Parameters:
rset - The result setindex - The index in the result set
- Returns:
- The value from the result set
- Throws:
SQLException
getFromResultSet
public Enum<?> getFromResultSet(ResultSet rset,
String field)
throws SQLException
- Description copied from interface:
DBType
- Do what you have to do to get and return this database type from a result set.
- Specified by:
getFromResultSet in interface DBType<Enum<?>>
- Parameters:
rset - The result setfield - The name of the field in the result set
- Returns:
- The value from the result set
- Throws:
SQLException
getTypeClass
public Class<? extends Object> getTypeClass()
- Description copied from interface:
DBType
- Return the java type representing this database type.
- Specified by:
getTypeClass in interface DBType<Enum<?>>
- Returns:
- The java type of this database type.
bindToStmt
public void bindToStmt(PreparedStatement stmt,
int index,
Enum<?> value)
throws SQLException
- Description copied from interface:
DBType
- Do what you have to do to bind a value to a prepared statement.
- Specified by:
bindToStmt in interface DBType<Enum<?>>
- Parameters:
stmt - The prepared statementindex - The index in the prepared statementvalue - The value to be bound to the prepared statement
- Throws:
SQLException
main
public static void main(String[] args)
throws Exception
- Throws:
Exception
Copyright © 2012. All Rights Reserved.