com.j256.ormlite.field.types
Class SqlDateType
java.lang.Object
com.j256.ormlite.field.BaseFieldConverter
com.j256.ormlite.field.types.BaseDataType
com.j256.ormlite.field.types.BaseDateType
com.j256.ormlite.field.types.DateType
com.j256.ormlite.field.types.SqlDateType
- All Implemented Interfaces:
- DataPersister, FieldConverter
public class SqlDateType
- extends DateType
Type that persists a Date object.
NOTE: This is not the same as the Date class handled with DateType. If it
recommended that you use the other Date class which is more standard to Java programs.
- Author:
- graywatson
| Methods inherited from class com.j256.ormlite.field.types.BaseDataType |
convertIdNumber, dataIsEqual, generateId, getAssociatedClasses, getAssociatedClassNames, getDefaultWidth, getPrimaryClass, getSqlType, isAppropriateId, isComparable, isEscapedDefaultValue, isEscapedValue, isPrimitive, isSelfGeneratedId, isValidGeneratedType, makeConfigObject |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SqlDateType
protected SqlDateType(SqlType sqlType,
Class<?>[] classes)
- Here for others to subclass.
getSingleton
public static SqlDateType getSingleton()
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. This takes the database representation and converts it into
a Java object. For example, if the type is a date-long then this will take a long which is stored in the database
and return a Date.
- Specified by:
sqlArgToJava in interface FieldConverter- Overrides:
sqlArgToJava in class DateType
- Parameters:
fieldType - Associated FieldType which may be null.sqlArg - SQL argument converted with FieldConverter.resultToSqlArg(FieldType, DatabaseResults, int) which will not be
null.
javaToSqlArg
public Object javaToSqlArg(FieldType fieldType,
Object javaObject)
- 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- Overrides:
javaToSqlArg in class DateType
getDefaultDateFormatConfig
protected BaseDateType.DateStringFormatConfig getDefaultDateFormatConfig()
- Description copied from class:
DateType
- Return the default date format configuration.
- Overrides:
getDefaultDateFormatConfig in class DateType
resultStringToJava
public Object resultStringToJava(FieldType fieldType,
String stringValue,
int columnPos)
- Description copied from interface:
FieldConverter
- Convert a string result value to the related Java field.
- Specified by:
resultStringToJava in interface FieldConverter- Overrides:
resultStringToJava in class BaseDataType
isValidForField
public boolean isValidForField(Field field)
- Description copied from interface:
DataPersister
- Return true if the field is appropriate for this persister otherwise false.
- Specified by:
isValidForField in interface DataPersister- Overrides:
isValidForField in class BaseDateType
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.