| |
|
| java.lang.Object org.hsqldb.Row org.hsqldb.CachedRow
All known Subclasses: org.hsqldb.CachedDataRow,
CachedRow | public class CachedRow extends Row (Code) | | In-memory representation of a disk-based database row object with methods
for serialization and de-serialization.
A CachedRow is normally part of a circular double linked list which
contains all of the Rows currently in the Cache for the database. It is
unlinked from this list when it is freed from the Cache to make way for
other rows.
New class from the Hypersonic Original
author: Thomas Mueller (Hypersonic SQL Group) version: 1.7.2 since: Hypersonic SQL |
NO_POS | final static int NO_POS(Code) | | |
hasDataChanged | protected boolean hasDataChanged(Code) | | Flag indicating unwritten data.
|
hasNodesChanged | boolean hasNodesChanged(Code) | | Flag indicating Node data has changed.
|
storageSize | int storageSize(Code) | | |
CachedRow | CachedRow()(Code) | | Default constructor used only in subclasses.
|
CachedRow | CachedRow(Table t, Object[] o) throws HsqlException(Code) | | Constructor for new Rows. Variable hasDataChanged is set to true in
order to indicate the data needs saving.
Parameters: t - table Parameters: o - row data throws: HsqlException - if a database access error occurs |
delete | public void delete() throws HsqlException(Code) | | This method is called only when the Row is deleted from the database
table. The links with all the other objects apart from the data
are removed.
throws: HsqlException - |
equals | public boolean equals(Object obj)(Code) | | With CACHED tables there may possibly exist two copies of the row.
All copies will have the same iPos.
Parameters: obj - row to compare boolean |
getRealSize | public int getRealSize(RowOutputInterface out)(Code) | | returned size does not include the row size written at the beginning
|
getStorageSize | public int getStorageSize()(Code) | | |
getTable | public Table getTable()(Code) | | Returns the Table to which this Row belongs.
Table |
getUpdatedRow | synchronized Row getUpdatedRow() throws HsqlException(Code) | | Using the internal reference to the Table, returns the current cached
Row. Valid for deleted rows only before any subsequent insert or
update on any cached table.
Access to tables while performing the internal operations for an
SQL statement result in CachedRow objects to be cleared from the cache.
This method returns the CachedRow, loading it to the cache if it is not
there.
the current Row in Cache for this Object throws: HsqlException - |
hasChanged | public boolean hasChanged()(Code) | | Returns true if Node data has changed.
boolean |
hashCode | public int hashCode()(Code) | | Hash code is valid only until a modification to the cache
file position of row |
isKeepInMemory | public synchronized boolean isKeepInMemory()(Code) | | Returns true if any of the Nodes for this row is a root node.
Used only in Cache.java to avoid removing the row from the cache.
boolean throws: HsqlException - |
setChanged | void setChanged()(Code) | | Sets flag for Node data change.
|
setNewNodes | void setNewNodes()(Code) | | used in CachedDataRow
|
setPos | public void setPos(int pos)(Code) | | Sets the file position for the row
Parameters: pos - position in data file |
setStorageSize | public void setStorageSize(int size)(Code) | | |
write | public void write(RowOutputInterface out)(Code) | | Used exclusively by Cache to save the row to disk. New implementation
in 1.7.2 writes out only the Node data if the table row data has not
changed. This situation accounts for the majority of invocations as
for each row deleted or inserted, the Nodes for several other rows
will change.
Parameters: output - data source throws: IOException - throws: HsqlException - |
|
|
|