ir.thinkinsql
Interface IRow

All Known Subinterfaces:
IRecord
All Known Implementing Classes:
BaseRecord, BaseRow

public interface IRow

Specifies the behavior of objects that represent a row of a ResultSet.

Binding:


Method Summary
 void afterRead(Database db)
          afterRead is called after the values from an IReader are placed on the row.
 java.lang.String[] getColumns()
          Returns an array of column names, from which fields are populated.
 Database getDatabase()
          Returns object's "home" database.
 java.lang.String[] getFields()
          Returns a list of bean properties to receive result set values.
<T> T
getTemporaryProperty(java.lang.Object key, java.lang.Class<T> returnType)
          Allows retrieval of values placed using putTemporaryProperty.
 void putTemporaryProperty(java.lang.Object key, java.lang.Object value)
          Allows placement of arbitrary, non-persisted values on the instance.
 boolean setValueSpecial(Database db, java.lang.String columnName, java.lang.String propertyName, java.lang.Object value)
          Provides a plug point to transform a value taken from the named column on a ResultSet before assigning it to the named property.
 

Method Detail

afterRead

void afterRead(Database db)
               throws java.lang.Exception
afterRead is called after the values from an IReader are placed on the row. This event handler can be implemented to perform any preparations that the IRow implementer may require before consuming code asks for values.

Throws:
java.lang.Exception

getColumns

java.lang.String[] getColumns()
                              throws java.lang.Exception
Returns an array of column names, from which fields are populated. The array returned must be parallel with that returned by getFields.

Throws:
java.lang.Exception

getDatabase

Database getDatabase()
                     throws java.lang.Exception
Returns object's "home" database.

Throws:
java.lang.Exception

getFields

java.lang.String[] getFields()
                             throws java.lang.Exception
Returns a list of bean properties to receive result set values. The array returned must be parallel with that returned by getColumns.

Throws:
java.lang.Exception

getTemporaryProperty

<T> T getTemporaryProperty(java.lang.Object key,
                           java.lang.Class<T> returnType)
Allows retrieval of values placed using putTemporaryProperty.

Parameters:
key -
returnType - saves casting
Returns:
value or null if not found

putTemporaryProperty

void putTemporaryProperty(java.lang.Object key,
                          java.lang.Object value)
Allows placement of arbitrary, non-persisted values on the instance.

Parameters:
key -
value -

setValueSpecial

boolean setValueSpecial(Database db,
                        java.lang.String columnName,
                        java.lang.String propertyName,
                        java.lang.Object value)
                        throws java.lang.Exception
Provides a plug point to transform a value taken from the named column on a ResultSet before assigning it to the named property.
Return true if a special assignment has been made, or false if the standard assignment method should be used.

Throws:
java.lang.Exception