public interface DataPersister extends FieldConverter
If you are defining your own custom persister, then chances are you should extend BaseDataType
. See
DatabaseField.persisterClass()
.
Modifier and Type | Method and Description |
---|---|
Object |
convertIdNumber(Number number)
Convert a
Number object to its primitive object suitable for assigning to a java 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.
|
String |
getSqlOtherType()
Get the type that should be used when defining this.
|
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 |
moveToNextValue(Object currentValue)
Move the current-value to the next value.
|
getSqlType, isStreamType, javaToSqlArg, makeConfigObject, parseDefaultString, resultStringToJava, resultToJava, resultToSqlArg, sqlArgToJava
Class<?>[] getAssociatedClasses()
String[] getAssociatedClassNames()
Object convertIdNumber(Number number)
Number
object to its primitive object suitable for assigning to a java 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) throws SQLException
SQLException
String getSqlOtherType()
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.