| java.lang.Object com.sun.rave.faces.data.DataCache
DataCache | public class DataCache implements Serializable(Code) | | Cache for row and column values that supports persisting the data behind
a UIData component across HTTP requests, without
requiring that the underlying JDBC connection remain open. It also includes
mechanisms to detect which row and column values have been updated, in order
to support minimal database activity when synchronizing these changes to
the underlying database.
DataCache declares itself to be Serializable
to conform to the J2EE platform requirement that session scope attributes
should be serializable on a distributable container. However, this will
only succeed if the actual cached column values are themselves
Serializable as well.
author: craigmcc |
Method Summary | |
public void | add(int rowIndex, Row row) | public void | clear() | public void | commit() Commit the updated state of all cached rows. | public Column | createColumn(String schemaName, String tableName, String columnName, int sqlType, Object original) | public Column | createColumn(String schemaName, String tableName, String columnName, int sqlType, Class javaType, Object original) | public Row | createRow(Column columns) | public Row | get(int rowIndex) | public Iterator | iterator() | public void | remove(int rowIndex) | public void | reset() |
add | public void add(int rowIndex, Row row)(Code) | | Add a new row entry to the cache, replacing any existing cache entry
for the same rowIndex value.
Parameters: rowIndex - Row index this row corresponds to Parameters: row - DataCache.Row to be added |
clear | public void clear()(Code) | | Clear any cached row and column data.
|
commit | public void commit()(Code) | | Commit the updated state of all cached rows. After this
method completes, the current values for all columns will
appear to be original, any rows marked deleted will be
removed, and no row will be considered updated.
|
createColumn | public Column createColumn(String schemaName, String tableName, String columnName, int sqlType, Object original)(Code) | | Create and return a Column instance configured
with the specified parameters.
Parameters: schemaName - Schema name of the table containing thiscolumn (if any) Parameters: tableName - Table name containing this column (if any) Parameters: columnName - Column name of this column Parameters: sqlType - SQL type (from java.sql.Types) Parameters: original - Original value for this column |
createColumn | public Column createColumn(String schemaName, String tableName, String columnName, int sqlType, Class javaType, Object original)(Code) | | Create and return a Column instance configured
with the specified parameters.
Parameters: schemaName - Schema name of the table containing thiscolumn (if any) Parameters: tableName - Table name containing this column (if any) Parameters: columnName - Column name of this column Parameters: sqlType - SQL type (from java.sql.Types) Parameters: javaType - Java type as would be returned by Class.forName(ResultSetMetaData.getColumnClassName) Parameters: original - Original value for this column |
createRow | public Row createRow(Column columns)(Code) | | Create and return a Row instance configured
with the specified parameters.
Parameters: columns - Column instances for this row |
get | public Row get(int rowIndex)(Code) | | Return the cached row associated with the specified row index,
if any; otherwise, return null .
Parameters: rowIndex - Row index for which to retrieve a row |
iterator | public Iterator iterator()(Code) | | Return an Iterator over the row index values
(of type java.lang.Integer ) for which cached data
is present.
S
|
remove | public void remove(int rowIndex)(Code) | | Remove any row entry corresponding to the specified
rowIndex .
Parameters: rowIndex - Row index for which to remove any cached data |
reset | public void reset()(Code) | | Reset the updated state of all rows and columns in the cache.
|
|
|