Package net.ontopia.persistence.proxy
Class DefaultFieldHandler
- java.lang.Object
-
- net.ontopia.persistence.proxy.DefaultFieldHandler
-
- All Implemented Interfaces:
FieldHandlerIF
public class DefaultFieldHandler extends Object implements FieldHandlerIF
INTERNAL: The default field handler implementation that is able to read values from result sets and bind values in prepared statements without any particular knowledge about fields. The field handler only works with single columns of the type specified in the class constructor.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
sql_type
-
Constructor Summary
Constructors Constructor Description DefaultFieldHandler(int sql_type)
Creates a instance of the default field handler by passing the SQL type to used for reading and storing column values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(Object value, PreparedStatement stm, int stmt_index)
INTERNAL: Binds the object field value starting from the given offset in the prepared statement.int
getColumnCount()
INTERNAL: Returns the number of columns that the field spans.boolean
isIdentityField()
INTERNAL: Returns true if the field handler references an object identity field.Object
load(AccessRegistrarIF registrar, TicketIF ticket, ResultSet rs, int rsindex, boolean direct)
INTERNAL: Reads the value beginning at the given offset in the current ResultSet row.void
retrieveFieldValues(Object value, List<Object> field_values)
void
retrieveSQLValues(Object value, List<SQLValueIF> sql_values)
String
toString()
-
-
-
Method Detail
-
getColumnCount
public int getColumnCount()
Description copied from interface:FieldHandlerIF
INTERNAL: Returns the number of columns that the field spans.- Specified by:
getColumnCount
in interfaceFieldHandlerIF
-
isIdentityField
public boolean isIdentityField()
Description copied from interface:FieldHandlerIF
INTERNAL: Returns true if the field handler references an object identity field.- Specified by:
isIdentityField
in interfaceFieldHandlerIF
-
load
public Object load(AccessRegistrarIF registrar, TicketIF ticket, ResultSet rs, int rsindex, boolean direct) throws SQLException
Description copied from interface:FieldHandlerIF
INTERNAL: Reads the value beginning at the given offset in the current ResultSet row. The number of columns actually read depends on the type of object field.- Specified by:
load
in interfaceFieldHandlerIF
- Throws:
SQLException
-
bind
public void bind(Object value, PreparedStatement stm, int stmt_index) throws SQLException
Description copied from interface:FieldHandlerIF
INTERNAL: Binds the object field value starting from the given offset in the prepared statement. The number of columns actually bound depends on the type of object field.- Specified by:
bind
in interfaceFieldHandlerIF
- Throws:
SQLException
-
retrieveFieldValues
public void retrieveFieldValues(Object value, List<Object> field_values)
- Specified by:
retrieveFieldValues
in interfaceFieldHandlerIF
-
retrieveSQLValues
public void retrieveSQLValues(Object value, List<SQLValueIF> sql_values)
- Specified by:
retrieveSQLValues
in interfaceFieldHandlerIF
-
-