com.j256.ormlite.field.types
Class DateLongType
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.DateLongType
- All Implemented Interfaces:
- DataPersister, FieldConverter
public class DateLongType
- extends BaseDateType
Persists the Date
Java class as long milliseconds since epoch.
NOTE: This is not the same as the Date
class.
- Author:
- graywatson
Methods inherited from class com.j256.ormlite.field.types.BaseDataType |
convertIdNumber, dataIsEqual, generateId, getAssociatedClasses, getDefaultWidth, getSqlType, isAppropriateId, isArgumentHolderRequired, isComparable, isEscapedDefaultValue, isPrimitive, isSelfGeneratedId, isValidGeneratedType, makeConfigObject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getSingleton
public static DateLongType 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.
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
- Overrides:
sqlArgToJava
in class BaseFieldConverter
- Parameters:
fieldType
- Associated FieldType which may be null.
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
- Overrides:
javaToSqlArg
in class BaseFieldConverter
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
This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.