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.
 
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)
                          throws SQLException
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
Throws:
SQLException

javaToSqlArg

public Object javaToSqlArg(FieldType fieldType,
                           Object obj)
                    throws SQLException
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
Throws:
SQLException

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.

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


Copyright © 2011. All Rights Reserved.