net.ontopia.persistence.proxy
Class DefaultFieldHandler

java.lang.Object
  extended by net.ontopia.persistence.proxy.DefaultFieldHandler
All Implemented Interfaces:
FieldHandlerIF

public class DefaultFieldHandler
extends java.lang.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
protected  int sql_type
           
 
Constructor Summary
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
 void bind(java.lang.Object value, java.sql.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.
 java.lang.Object load(AccessRegistrarIF registrar, TicketIF ticket, java.sql.ResultSet rs, int rsindex, boolean direct)
          INTERNAL: Reads the value beginning at the given offset in the current ResultSet row.
 void retrieveFieldValues(java.lang.Object value, java.util.List field_values)
           
 void retrieveSQLValues(java.lang.Object value, java.util.List sql_values)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sql_type

protected int sql_type
Constructor Detail

DefaultFieldHandler

public 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 Detail

getColumnCount

public int getColumnCount()
Description copied from interface: FieldHandlerIF
INTERNAL: Returns the number of columns that the field spans.

Specified by:
getColumnCount in interface FieldHandlerIF

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 interface FieldHandlerIF

load

public java.lang.Object load(AccessRegistrarIF registrar,
                             TicketIF ticket,
                             java.sql.ResultSet rs,
                             int rsindex,
                             boolean direct)
                      throws java.sql.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 interface FieldHandlerIF
Throws:
java.sql.SQLException

bind

public void bind(java.lang.Object value,
                 java.sql.PreparedStatement stm,
                 int stmt_index)
          throws java.sql.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 interface FieldHandlerIF
Throws:
java.sql.SQLException

retrieveFieldValues

public void retrieveFieldValues(java.lang.Object value,
                                java.util.List field_values)
Specified by:
retrieveFieldValues in interface FieldHandlerIF

retrieveSQLValues

public void retrieveSQLValues(java.lang.Object value,
                              java.util.List sql_values)
Specified by:
retrieveSQLValues in interface FieldHandlerIF

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2000-2012 Ontopia.