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
 int getJdbcTypeVal()
          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 javaToArg(Object javaObject)
          Convert a Java object and return the appropriate argument to a SQL insert or update statement.
 Object parseDefaultString(String defaultStr)
          Convert a default string object and return the appropriate argument to a SQL insert or update statement.
 Object resultToJava(FieldType fieldType, Results 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

getJdbcTypeVal

public int getJdbcTypeVal()
Description copied from interface: FieldConverter
Return the SQL type that is stored in the database for this argument. This should be one of the Types constants.

Specified by:
getJdbcTypeVal in interface FieldConverter

parseDefaultString

public Object parseDefaultString(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

javaToArg

public Object javaToArg(Object javaObject)
                 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:
javaToArg in interface FieldConverter
Throws:
SQLException

resultToJava

public Object resultToJava(FieldType fieldType,
                           Results 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
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 © 2010. All Rights Reserved.