dsql.value
Class TableResult

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

public abstract class TableResult
extends NonScalarValue
implements Cursor, ColumnHolder

A table, i.e. a complex value with rows and columns


Field Summary
protected  int[] primaryKeys
           
 
Constructor Summary
TableResult()
           
 
Method Summary
abstract  void deleteRecord()
           
 boolean equalsRecord(ColumnHolder r)
           
protected abstract  int findColumn(java.lang.String label)
           
 boolean getBoolean()
           
 int getColumnDisplaySize(int i)
           
 java.lang.Object getField(java.lang.String name)
          Access a column
abstract  ConstructedResults getMeta()
           
 int[] getPrimaryKeys()
           
 Value getRecord()
          get current record; this could be the actual record, as does XmlRecordHolder, or a "proxy" as does TableResult
 Value getRecord(int i)
           
 java.lang.String getString()
          In a string context, a TableResults returns the first column of the first row of its first result
 java.lang.String getTableName()
           
abstract  void insert(ColumnHolder rec)
           
 void print(ASTPrint printer)
          Print this value using printer
 void printRecord(ASTPrint printer)
           
abstract  java.lang.String[] readCurrentRecord()
           
 int[] setPrimaryKeys(int[] _keys)
           
 int[] setPrimaryKeys(java.lang.String[] keysStr)
           
 void setRecord(int i, Value val)
           
abstract  void update(ColumnHolder rec)
           
 
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, toString, wait, wait, wait
 
Methods inherited from interface dsql.value.Cursor
currentRecord, gotoRecord, nextRecord, reset
 
Methods inherited from interface dsql.value.RecordHolder
getRecordCount
 
Methods inherited from interface dsql.value.ColumnHolder
getColumn, getColumn, getColumnCount, getColumnLabel, getColumnString, getColumnString
 

Field Detail

primaryKeys

protected int[] primaryKeys
Constructor Detail

TableResult

public TableResult()
Method Detail

getTableName

public java.lang.String getTableName()

getColumnDisplaySize

public int getColumnDisplaySize(int i)
                         throws ExecuteException
Specified by:
getColumnDisplaySize in interface ColumnHolder
Throws:
ExecuteException

getField

public java.lang.Object getField(java.lang.String name)
                          throws ExecuteException
Access a column

Overrides:
getField in class NonScalarValue
Throws:
ExecuteException

equalsRecord

public boolean equalsRecord(ColumnHolder r)
                     throws ExecuteException
Throws:
ExecuteException

printRecord

public void printRecord(ASTPrint printer)
                 throws ExecuteException
Specified by:
printRecord in interface Cursor
Throws:
ExecuteException

print

public void print(ASTPrint printer)
           throws ExecuteException
Description copied from class: Value
Print this value using printer

Specified by:
print in class Value
Throws:
ExecuteException

getString

public java.lang.String getString()
                           throws ExecuteException
In a string context, a TableResults returns the first column of the first row of its first result

Specified by:
getString in class Value
Returns:
a string representation of this value, to be used within dsql expressions. This is distinct from toString(), which is used to output the object for debugging purposes.
Throws:
ExecuteException

getBoolean

public boolean getBoolean()
                   throws ExecuteException
Specified by:
getBoolean in class Value
Returns:
true if has some records
Throws:
ExecuteException

getPrimaryKeys

public int[] getPrimaryKeys()
                     throws ExecuteException
Throws:
ExecuteException

setPrimaryKeys

public int[] setPrimaryKeys(java.lang.String[] keysStr)
                     throws ExecuteException
Throws:
ExecuteException

setPrimaryKeys

public int[] setPrimaryKeys(int[] _keys)

findColumn

protected abstract int findColumn(java.lang.String label)
                           throws ExecuteException
Throws:
ExecuteException

getMeta

public abstract ConstructedResults getMeta()
                                    throws ExecuteException
Specified by:
getMeta in class Value
Returns:
meta-information about this Value, e.g. for a table, it returns the names,types,width,etc. of its columns.
Throws:
ExecuteException

insert

public abstract void insert(ColumnHolder rec)
                     throws ExecuteException
Throws:
ExecuteException

deleteRecord

public abstract void deleteRecord()
                           throws ExecuteException
Throws:
ExecuteException

update

public abstract void update(ColumnHolder rec)
                     throws ExecuteException
Throws:
ExecuteException

getRecord

public Value getRecord()
                throws ExecuteException
Description copied from interface: Cursor
get current record; this could be the actual record, as does XmlRecordHolder, or a "proxy" as does TableResult

Specified by:
getRecord in interface Cursor
Throws:
ExecuteException

getRecord

public Value getRecord(int i)
                throws ExecuteException
Specified by:
getRecord in interface RecordHolder
Returns:
record at position i (first record is 1). For SQL cursors, the returned Value can be a ProxyRecord
Throws:
ExecuteException

setRecord

public void setRecord(int i,
                      Value val)
               throws ExecuteException
Specified by:
setRecord in interface RecordHolder
Throws:
ExecuteException

readCurrentRecord

public abstract java.lang.String[] readCurrentRecord()
                                              throws ExecuteException
Throws:
ExecuteException