public abstract class BaseFieldConverter extends Object implements FieldConverter
Constructor and Description |
---|
BaseFieldConverter() |
Modifier and Type | Method and Description |
---|---|
boolean |
isStreamType()
Return whether or not this is a SQL "stream" object.
|
Object |
javaToSqlArg(FieldType fieldType,
Object javaObject)
Convert a Java object and return the appropriate argument to a SQL insert or update statement.
|
Object |
makeConfigObject(FieldType fieldType)
This makes a configuration object for the data-type or returns null if none.
|
Object |
resultToJava(FieldType fieldType,
DatabaseResults results,
int columnPos)
This is usually just a call that takes the result from
FieldConverter.resultToSqlArg(FieldType, DatabaseResults, int)
and passes it through FieldConverter.sqlArgToJava(FieldType, Object, int) . |
Object |
sqlArgToJava(FieldType fieldType,
Object sqlArg,
int columnPos)
Return the object converted from the SQL arg to java.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSqlType, parseDefaultString, resultStringToJava, resultToSqlArg
public Object javaToSqlArg(FieldType fieldType, Object javaObject) throws SQLException
FieldConverter
javaToSqlArg
in interface FieldConverter
SQLException
- If there are problems with the conversion.public Object resultToJava(FieldType fieldType, DatabaseResults results, int columnPos) throws SQLException
FieldConverter
FieldConverter.resultToSqlArg(FieldType, DatabaseResults, int)
and passes it through FieldConverter.sqlArgToJava(FieldType, Object, int)
.resultToJava
in interface FieldConverter
SQLException
public Object sqlArgToJava(FieldType fieldType, Object sqlArg, int columnPos) throws SQLException
FieldConverter
sqlArgToJava
in interface FieldConverter
fieldType
- Associated FieldType which may be null.sqlArg
- SQL argument converted with FieldConverter.resultToSqlArg(FieldType, DatabaseResults, int)
which will not be
null.SQLException
- If there are problems with the conversion.public boolean isStreamType()
FieldConverter
isStreamType
in interface FieldConverter
public Object makeConfigObject(FieldType fieldType) throws SQLException
FieldConverter
FieldType.getDataTypeConfigObj()
.makeConfigObject
in interface FieldConverter
SQLException
- If there are problems creating the config object. Needed for subclasses.FieldConverter.makeConfigObject(FieldType)
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.