| java.lang.Object org.apache.derby.impl.sql.execute.AutoincrementCounter
AutoincrementCounter | public class AutoincrementCounter (Code) | | AutoincrementCounter is a not so general counter for the specific purposes
of autoincrement columns. It can be thought of as an in-memory autoincrement
column.
The counting or incrementing is done in fashion identical to the
AUTOINCREMENTVALUE in SYSCOLUMNS.
To create a counter, the user must call the constructor with a start value,
increment and optionally a final value. In addition the caller must specify
the schema name, table name and column name uniquely identifying the
counter.
When a counter is created it is in an invalid state-- to initialize it, the
user must call either update or reset(false). The value of a
counter can be changed by either calling reset or update.
author: manish |
Constructor Summary | |
public | AutoincrementCounter(Long start, long increment, long finalValue, String s, String t, String c, int position) constructor
Parameters: start - The start value of the counter; is a java object asit can also be null. Parameters: increment - how much to increment the counter by. Parameters: finalValue - the finalvalue of the counter. |
AutoincrementCounter | public AutoincrementCounter(Long start, long increment, long finalValue, String s, String t, String c, int position)(Code) | | constructor
Parameters: start - The start value of the counter; is a java object asit can also be null. Parameters: increment - how much to increment the counter by. Parameters: finalValue - the finalvalue of the counter. used by reset Parameters: s - Parameters: t - Parameters: c - |
flushToDisk | public void flushToDisk(TransactionController tc, DataDictionary dd, UUID tableUUID) throws StandardException(Code) | | flush a counter to disk; i.e write the current value of the counter into
the row in SYSCOLUMNS.
Parameters: tc - TransactionController to use Parameters: dd - DataDictionary to use. Parameters: tableUUID - I might have the table name but I need moreinformation exception: StandardException - standard cloudscape exception. |
getColumnPosition | public int getColumnPosition()(Code) | | get the column position in the table for which this counter has been
created.
the position of the corresponding column in the table (1-based) |
getCurrentValue | public Long getCurrentValue()(Code) | | get the current value of the counter. An uninitialized counter means the
current value is NULL.
|
getIdentity | public String getIdentity()(Code) | | return the identity of the counter.
|
getStartValue | public Long getStartValue()(Code) | | get the start value
the initial value of the counter |
reset | public void reset(boolean begin)(Code) | | reset to the counter to the beginning or the end.
Parameters: begin - if TRUE reset to beginning and mark it uninitialized. |
update | public long update(long t)(Code) | | update the counter.
Parameters: t - update the counter to this value. |
|
|