com.j256.ormlite.field.types
Class BigDecimalNumericType

java.lang.Object
  extended by com.j256.ormlite.field.BaseFieldConverter
      extended by com.j256.ormlite.field.types.BaseDataType
          extended by com.j256.ormlite.field.types.BigDecimalNumericType
All Implemented Interfaces:
DataPersister, FieldConverter

public class BigDecimalNumericType
extends BaseDataType

Type that persists a BigInteger object as a NUMERIC SQL database field.

Author:
graywatson

Constructor Summary
protected BigDecimalNumericType(SqlType sqlType, Class<?>[] classes)
          Here for others to subclass.
 
Method Summary
 Class<?> getPrimaryClass()
          Return the class most associated with this persister or null if none.
static BigDecimalNumericType getSingleton()
           
 boolean isAppropriateId()
          Return true if this data type can be an id column in a class.
 boolean isEscapedValue()
          Return whether we need to escape this value in SQL expressions.
 Object parseDefaultString(FieldType fieldType, String defaultStr)
          Convert a default string object and return the appropriate argument to a SQL insert or update statement.
 Object resultToSqlArg(FieldType fieldType, DatabaseResults results, int columnPos)
          Return the SQL argument object extracted from the results associated with column in position columnPos.
 
Methods inherited from class com.j256.ormlite.field.types.BaseDataType
convertIdNumber, dataIsEqual, generateId, getAssociatedClasses, getAssociatedClassNames, getDefaultWidth, getSqlType, isArgumentHolderRequired, isComparable, isEscapedDefaultValue, isPrimitive, isSelfGeneratedId, isValidForField, isValidForVersion, isValidGeneratedType, makeConfigObject, moveToNextValue, resultStringToJava
 
Methods inherited from class com.j256.ormlite.field.BaseFieldConverter
isStreamType, javaToSqlArg, resultToJava, sqlArgToJava
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.j256.ormlite.field.FieldConverter
isStreamType, javaToSqlArg, resultToJava, sqlArgToJava
 

Constructor Detail

BigDecimalNumericType

protected BigDecimalNumericType(SqlType sqlType,
                                Class<?>[] classes)
Here for others to subclass.

Method Detail

getSingleton

public static BigDecimalNumericType getSingleton()

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
Specified by:
parseDefaultString in class BaseDataType
Throws:
SQLException

resultToSqlArg

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

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

isAppropriateId

public boolean isAppropriateId()
Description copied from interface: DataPersister
Return true if this data type can be an id column in a class.

Specified by:
isAppropriateId in interface DataPersister
Overrides:
isAppropriateId in class BaseDataType

isEscapedValue

public boolean isEscapedValue()
Description copied from interface: DataPersister
Return whether we need to escape this value in SQL expressions. Numbers _must_ not be escaped but most other values should be.

Specified by:
isEscapedValue in interface DataPersister
Overrides:
isEscapedValue in class BaseDataType

getPrimaryClass

public Class<?> getPrimaryClass()
Description copied from interface: DataPersister
Return the class most associated with this persister or null if none.

Specified by:
getPrimaryClass in interface DataPersister
Overrides:
getPrimaryClass in class BaseDataType


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