com.j256.ormlite.db
Class OracleDatabaseType.BooleanFieldConverter
java.lang.Object
com.j256.ormlite.field.BaseFieldConverter
com.j256.ormlite.db.OracleDatabaseType.BooleanFieldConverter
- All Implemented Interfaces:
- com.j256.ormlite.field.FieldConverter
- Enclosing class:
- OracleDatabaseType
protected static class OracleDatabaseType.BooleanFieldConverter
- extends com.j256.ormlite.field.BaseFieldConverter
Booleans in Oracle are stored as the character '1' or '0'. You can change the characters by specifying a format
string. It must be a string with 2 characters. The first character is the value for TRUE, the second is FALSE.
@DatabaseField(format = "YN")
You can also specify the format as "integer" to use an integer column type and the value 1 (really non-0) for
true and 0 for false:
@DatabaseField(format = "integer")
Thanks much to stew.
Methods inherited from class com.j256.ormlite.field.BaseFieldConverter |
isStreamType, resultToJava |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OracleDatabaseType.BooleanFieldConverter
protected OracleDatabaseType.BooleanFieldConverter()
getSqlType
public com.j256.ormlite.field.SqlType getSqlType()
parseDefaultString
public Object parseDefaultString(com.j256.ormlite.field.FieldType fieldType,
String defaultStr)
throws SQLException
- Throws:
SQLException
javaToSqlArg
public Object javaToSqlArg(com.j256.ormlite.field.FieldType fieldType,
Object obj)
throws SQLException
- Specified by:
javaToSqlArg
in interface com.j256.ormlite.field.FieldConverter
- Overrides:
javaToSqlArg
in class com.j256.ormlite.field.BaseFieldConverter
- Throws:
SQLException
resultToSqlArg
public Object resultToSqlArg(com.j256.ormlite.field.FieldType fieldType,
com.j256.ormlite.support.DatabaseResults results,
int columnPos)
throws SQLException
- Throws:
SQLException
sqlArgToJava
public Object sqlArgToJava(com.j256.ormlite.field.FieldType fieldType,
Object sqlArg,
int columnPos)
throws SQLException
- Specified by:
sqlArgToJava
in interface com.j256.ormlite.field.FieldConverter
- Overrides:
sqlArgToJava
in class com.j256.ormlite.field.BaseFieldConverter
- Throws:
SQLException
resultStringToJava
public Object resultStringToJava(com.j256.ormlite.field.FieldType fieldType,
String stringValue,
int columnPos)
throws SQLException
- Throws:
SQLException
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.