dsql.value
Class ConstructedTable

java.lang.Object
  extended bydsql.DMExecuted
      extended bydsql.value.Value
          extended bydsql.value.NonScalarValue
              extended bydsql.value.TableResult
                  extended bydsql.value.ConstructedTable
All Implemented Interfaces:
ColumnHolder, Cursor, RecordHolder
Direct Known Subclasses:
ConstructedTableHash

public class ConstructedTable
extends TableResult

A ConstructedResults value


Field Summary
 
Fields inherited from class dsql.value.TableResult
primaryKeys
 
Constructor Summary
ConstructedTable(DSQL _caller, java.lang.String[] labels)
           
ConstructedTable(TableResult source)
          Creates a table with the same structure as source
 
Method Summary
 void addRecord(java.lang.String[] record)
           
 int currentRecord()
           
 void deleteRecord()
           
protected  int findColumn(java.lang.String label)
          needed by TableResult.setPrimaryKeys
 java.lang.Object getColumn(int i)
           
 java.lang.Object getColumn(java.lang.String s)
           
 int getColumnCount()
           
 int getColumnDisplaySize(int k)
           
 java.lang.String getColumnLabel(int i)
           
 java.lang.String getColumnString(int i)
           
 java.lang.String getColumnString(java.lang.String s)
           
 ConstructedResults getMeta()
           
 int[] getPrimaryKeys()
           
 int getRecordCount()
          this function should be called with care as it can be computationaly expensive for SQL Cursors!
 java.lang.String getTableName()
           
 void gotoRecord(int pos)
           
 void insert(ColumnHolder rec)
           
 void insert(TableResult source)
           
 boolean nextRecord()
           
 java.lang.String[] readCurrentRecord()
           
 void reset()
           
 void setId(java.lang.String _id)
           
protected  int setMetaLocal(java.lang.String[] colValues, int[] keys, int i, int keysIndex)
           
 java.lang.String toString()
           
 void update(ColumnHolder rec)
           
protected  void update(int col, java.lang.Object val)
           
 
Methods inherited from class dsql.value.TableResult
equalsRecord, getBoolean, getField, getRecord, getRecord, getString, print, printRecord, setPrimaryKeys, setPrimaryKeys, setRecord
 
Methods inherited from class dsql.value.NonScalarValue
getFields, isScalar, setField
 
Methods inherited from class dsql.value.Value
getFloat, getInt, getObject, getObjectClass, getRecordHolder, getType, getValue, getValue
 
Methods inherited from class dsql.DMExecuted
getCaller, setCaller
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstructedTable

public ConstructedTable(DSQL _caller,
                        java.lang.String[] labels)

ConstructedTable

public ConstructedTable(TableResult source)
                 throws ExecuteException
Creates a table with the same structure as source

Method Detail

getTableName

public java.lang.String getTableName()
Overrides:
getTableName in class TableResult

setId

public void setId(java.lang.String _id)

toString

public java.lang.String toString()

insert

public void insert(TableResult source)
            throws ExecuteException
Throws:
ExecuteException

readCurrentRecord

public java.lang.String[] readCurrentRecord()
                                     throws ExecuteException
Specified by:
readCurrentRecord in class TableResult
Throws:
ExecuteException

addRecord

public void addRecord(java.lang.String[] record)
               throws ExecuteException
Throws:
ExecuteException

getColumnString

public java.lang.String getColumnString(int i)
                                 throws ExecuteException
Throws:
ExecuteException

getColumn

public java.lang.Object getColumn(int i)
                           throws ExecuteException
Parameters:
i - column number (first column is 1)
Returns:
column value; usually a String, but can also be a complex object, such as XmlDataValue.
Throws:
ExecuteException

getColumnString

public java.lang.String getColumnString(java.lang.String s)
                                 throws ExecuteException
Throws:
ExecuteException

getColumn

public java.lang.Object getColumn(java.lang.String s)
                           throws ExecuteException
Parameters:
s - column name
Returns:
column value; usually a String, but can also be a complex object, such as XmlDataValue.
Throws:
ExecuteException

getColumnLabel

public java.lang.String getColumnLabel(int i)

getColumnDisplaySize

public int getColumnDisplaySize(int k)
                         throws ExecuteException
Specified by:
getColumnDisplaySize in interface ColumnHolder
Overrides:
getColumnDisplaySize in class TableResult
Throws:
ExecuteException

getColumnCount

public int getColumnCount()

getRecordCount

public int getRecordCount()
Description copied from interface: RecordHolder
this function should be called with care as it can be computationaly expensive for SQL Cursors!

Returns:
number of records

getMeta

public ConstructedResults getMeta()
                           throws ExecuteException
Specified by:
getMeta in class TableResult
Throws:
ExecuteException

setMetaLocal

protected int setMetaLocal(java.lang.String[] colValues,
                           int[] keys,
                           int i,
                           int keysIndex)

reset

public void reset()

nextRecord

public boolean nextRecord()
                   throws ExecuteException
Throws:
ExecuteException

currentRecord

public int currentRecord()
                  throws ExecuteException
Throws:
ExecuteException

gotoRecord

public void gotoRecord(int pos)
                throws ExecuteException
Parameters:
pos - is the record position: 1 is the first record, 0 is the record before first, -1 is after the last record
Throws:
ExecuteException

getPrimaryKeys

public int[] getPrimaryKeys()
                     throws ExecuteException
Overrides:
getPrimaryKeys in class TableResult
Throws:
ExecuteException

insert

public void insert(ColumnHolder rec)
            throws ExecuteException
Specified by:
insert in class TableResult
Throws:
ExecuteException

deleteRecord

public void deleteRecord()
                  throws ExecuteException
Specified by:
deleteRecord in class TableResult
Throws:
ExecuteException

update

public void update(ColumnHolder rec)
            throws ExecuteException
Specified by:
update in class TableResult
Throws:
ExecuteException

update

protected void update(int col,
                      java.lang.Object val)
               throws ExecuteException
Throws:
ExecuteException

findColumn

protected int findColumn(java.lang.String label)
                  throws ExecuteException
needed by TableResult.setPrimaryKeys

Specified by:
findColumn in class TableResult
Returns:
index of label column in table
Throws:
ExecuteException