public abstract class HubTableRow extends Object implements Cloneable, Comparable<HubTableRow>
Specific table row classes are generated based on the table schema specified in the SQL create statement.
A java user can extend a specific table row class with his own data items and his own methods. The specific table row classes are NOT declared final.
Modifier and Type | Field and Description |
---|---|
static char |
keySep
The separation character for composite key values.
|
Constructor and Description |
---|
HubTableRow() |
Modifier and Type | Method and Description |
---|---|
HubTableRow |
clone()
The table needs to create rows without coding with the class name.
|
int |
compareTo(HubTableRow o)
compareTo gets replaced in derived classes.
|
String |
csvFieldValue(HubTableColumn tc)
obtain a value for Comma Separated Value (CSV) export
|
boolean |
fieldCompare(HubTableColumn tc,
HubTableRow row)
Compare a column value in this row to the value in another row
|
String |
fieldValue(HubTableColumn tc,
boolean quotedStrings)
SQL scripting method used to obtain a value
|
abstract HubTableColumn[] |
getCols()
obtain the columns of the table
|
abstract String |
getKey()
obtain the primary composite key (PCK) value
|
abstract HubTableColumn[] |
getKeyCols()
obtain the key columns of the table
|
String |
getStringAt(int col)
Obtain a field value.
|
Object |
getValueAt(int col)
Obtain a field value.
|
String |
getWhereClause()
a where clause for this row
|
void |
lappend(ListBuilder list,
HubTableColumn tc)
A value access method used to append a value to a value list
|
boolean |
setValueAt(HubTableColumn htc,
String value)
Set a field value.
|
boolean |
setValueAt(int col,
String value)
Set a field value.
|
String |
toCsv()
the Comma Separated Value of this row
|
String |
toString()
A simple name=value[, name=value]* display useful for
logging and debugging
|
static String |
varchar(String s,
int maxlen)
Used to truncate string values to the declared field length
|
public static final char keySep
public HubTableRow clone()
A java user can pass a row for inserting or update which may not have proper values so we are filtering.
clone
in class Object
public int compareTo(HubTableRow o)
Selection results are returned in natural sorted order without explicit sorting. However, the natural sorted order has numeric values sorted as text.
A selection result can be explicitly sorted to fix the text sorting of numeric values; (1,10,2,20) becomes (1,2,10,20).
compareTo
in interface Comparable<HubTableRow>
public String csvFieldValue(HubTableColumn tc)
public boolean fieldCompare(HubTableColumn tc, HubTableRow row)
tc
- columnrow
- public String fieldValue(HubTableColumn tc, boolean quotedStrings)
public abstract HubTableColumn[] getCols()
public abstract String getKey()
public abstract HubTableColumn[] getKeyCols()
public String getStringAt(int col)
col
- column index starting from 0public Object getValueAt(int col)
col
- column index starting from 0public String getWhereClause()
public void lappend(ListBuilder list, HubTableColumn tc)
public boolean setValueAt(HubTableColumn htc, String value)
htc
- columnvalue
- assignment valuepublic boolean setValueAt(int col, String value)
col
- column index starting from 0value
- assignment valuepublic String toCsv()
public String toString()
toString
in class Object
public static String varchar(String s, int maxlen)