|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DataPersister
Data type that provide Java class to/from database mapping.
If you are defining your own custom persister, then chances are you should extend BaseDataType
. See
DatabaseField.persisterClass()
.
Method Summary | |
---|---|
Object |
convertIdNumber(Number number)
Convert a Number object to its primitive object suitable for assigning to an ID field. |
boolean |
dataIsEqual(Object obj1,
Object obj2)
Compare two fields of this type returning true if equals else false. |
Object |
generateId()
Return a generated id if appropriate or null if none. |
Class<?>[] |
getAssociatedClasses()
Return the classes that should be associated with this. |
String[] |
getAssociatedClassNames()
Return the class names that should be associated with this or null. |
int |
getDefaultWidth()
Return the default width associated with this type or 0 if none. |
Class<?> |
getPrimaryClass()
Return the class most associated with this persister or null if none. |
boolean |
isAppropriateId()
Return true if this data type can be an id column in a class. |
boolean |
isArgumentHolderRequired()
Must use ArgumentHolder when querying for values of this type. |
boolean |
isComparable()
Return true if this data type be compared in SQL statements. |
boolean |
isEscapedDefaultValue()
Return whether this field's default value should be escaped in SQL. |
boolean |
isEscapedValue()
Return whether we need to escape this value in SQL expressions. |
boolean |
isPrimitive()
Return whether this field is a primitive type or not. |
boolean |
isSelfGeneratedId()
Return true if this type creates its own generated ids else false to have the database do it. |
boolean |
isValidForField(Field field)
Return true if the field is appropriate for this persister otherwise false. |
boolean |
isValidForVersion()
Return true if this is a valid field for the DatabaseField.version() . |
boolean |
isValidGeneratedType()
Return true if this type can be auto-generated by the database. |
Object |
makeConfigObject(FieldType fieldType)
This makes a configuration object for the data-type or returns null if none. |
Object |
moveToNextValue(Object currentValue)
Move the current-value to the next value. |
Methods inherited from interface com.j256.ormlite.field.FieldConverter |
---|
getSqlType, isStreamType, javaToSqlArg, parseDefaultString, resultStringToJava, resultToJava, resultToSqlArg, sqlArgToJava |
Method Detail |
---|
Class<?>[] getAssociatedClasses()
String[] getAssociatedClassNames()
Object makeConfigObject(FieldType fieldType) throws SQLException
FieldType.getDataTypeConfigObj()
.
SQLException
Object convertIdNumber(Number number)
Number
object to its primitive object suitable for assigning to an ID field.
boolean isValidGeneratedType()
boolean isValidForField(Field field)
Class<?> getPrimaryClass()
boolean isEscapedDefaultValue()
boolean isEscapedValue()
boolean isPrimitive()
boolean isComparable()
boolean isAppropriateId()
boolean isArgumentHolderRequired()
ArgumentHolder
when querying for values of this type.
boolean isSelfGeneratedId()
Object generateId()
int getDefaultWidth()
boolean dataIsEqual(Object obj1, Object obj2)
boolean isValidForVersion()
DatabaseField.version()
.
Object moveToNextValue(Object currentValue)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |