com.j256.ormlite.db
Class BaseDatabaseType.BooleanNumberFieldConverter

java.lang.Object
  extended by com.j256.ormlite.db.BaseDatabaseType.BooleanNumberFieldConverter
All Implemented Interfaces:
FieldConverter
Enclosing class:
BaseDatabaseType

protected static class BaseDatabaseType.BooleanNumberFieldConverter
extends Object
implements FieldConverter

Conversion to/from the Boolean Java field as a number because some databases like the true/false.


Constructor Summary
protected BaseDatabaseType.BooleanNumberFieldConverter()
           
 
Method Summary
 SqlType getSqlType()
          Return the SQL type that is stored in the database for this argument.
 boolean isStreamType()
          Return whether or not this is a SQL "stream" object.
 Object javaToSqlArg(FieldType fieldType, Object obj)
          Convert a Java object and return the appropriate argument to a SQL insert or update statement.
 Object parseDefaultString(FieldType fieldType, String defaultStr)
          Convert a default string object and return the appropriate argument to a SQL insert or update statement.
 Object resultToJava(FieldType fieldType, DatabaseResults results, int columnPos)
          Return the object extracted from the results associated with column in position columnPos.
 Object sqlArgToJava(FieldType fieldType, Object sqlArg, int columnPos)
          Return the object converted from the SQL arg to java.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseDatabaseType.BooleanNumberFieldConverter

protected BaseDatabaseType.BooleanNumberFieldConverter()
Method Detail

getSqlType

public SqlType getSqlType()
Description copied from interface: FieldConverter
Return the SQL type that is stored in the database for this argument.

Specified by:
getSqlType in interface FieldConverter

parseDefaultString

public Object parseDefaultString(FieldType fieldType,
                                 String defaultStr)
Description copied from interface: FieldConverter
Convert a default string object and return the appropriate argument to a SQL insert or update statement.

Specified by:
parseDefaultString in interface FieldConverter

javaToSqlArg

public Object javaToSqlArg(FieldType fieldType,
                           Object obj)
Description copied from interface: FieldConverter
Convert a Java object and return the appropriate argument to a SQL insert or update statement.

Specified by:
javaToSqlArg in interface FieldConverter

resultToJava

public Object resultToJava(FieldType fieldType,
                           DatabaseResults results,
                           int columnPos)
                    throws SQLException
Description copied from interface: FieldConverter
Return the object extracted from the results associated with column in position columnPos.

Specified by:
resultToJava in interface FieldConverter
Parameters:
fieldType - Associated FieldType which may be null.
Throws:
SQLException - If there is a problem accessing the results data.

sqlArgToJava

public Object sqlArgToJava(FieldType fieldType,
                           Object sqlArg,
                           int columnPos)
Description copied from interface: FieldConverter
Return the object converted from the SQL arg to java.

Specified by:
sqlArgToJava in interface FieldConverter
Parameters:
fieldType - Associated FieldType which may be null.

isStreamType

public boolean isStreamType()
Description copied from interface: FieldConverter
Return whether or not this is a SQL "stream" object. Cannot get certain stream objects from the SQL results more than once. If true, the converter has to protect itself against null values.

Specified by:
isStreamType in interface FieldConverter


This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.