public class EmptyTableDefinition
extends java.lang.Object
Constructor and Description |
---|
EmptyTableDefinition(java.lang.String tableName) |
Modifier and Type | Method and Description |
---|---|
int |
addTableItem(PamTableItem pamTableItem)
Adds a new table item
|
static java.lang.String |
deblankString(java.lang.String str)
Function to remove leading and trailing blanks and to
replace spaces in a database table or column name
with the _ character.
|
PamTableItem |
findTableItem(PamTableItem tableItem)
Searches the table definition to see if a TableItem already exists
with the same name as tableITem.
|
PamTableItem |
findTableItem(java.lang.String itemName)
Searches the existing table defnition to see if a table item
already exists with a given name.
|
java.lang.String |
getBasicSelectString(SQLTypes sqlTypes) |
PamTableItem |
getIndexItem() |
java.lang.String |
getSQLInsertString(SQLTypes sqlTypes)
gets an sql insert string for the table that selects all fields.
|
java.lang.String |
getSQLSelectString(SQLTypes sqlTypes)
Get a very basic select string which queries for all items in the
table, no ordering or selection
|
PamTableItem |
getTableItem(int itemNumber) |
int |
getTableItemCount() |
java.lang.String |
getTableName() |
boolean |
isUseCheatIndexing()
Cheat at database indexing.
|
static java.lang.String |
reblankString(java.lang.String str)
Function to replace the _ character in a database table or column name
with spaces to use with displays.
|
PamTableItem |
removeTableItem(int itemIndex)
Removes a table item from the table definition.
|
boolean |
removeTableItem(PamTableItem item)
Removes a table item from the table definition.
|
void |
setTableName(java.lang.String tableName) |
void |
setUseCheatIndexing(boolean useCheatIndexing)
Cheat at database indexing.
|
boolean |
unpackResultSet(java.sql.ResultSet resultSet)
Move the data out of a result set into the holding places in the table items.
|
public EmptyTableDefinition(java.lang.String tableName)
tableName
- public static java.lang.String deblankString(java.lang.String str)
str
- database table or column namepublic static java.lang.String reblankString(java.lang.String str)
str
- database table or column namepublic java.lang.String getTableName()
public void setTableName(java.lang.String tableName)
public PamTableItem getTableItem(int itemNumber)
itemNumber
- Table item index (0 indexed)PamTableItem
public int getTableItemCount()
PamTableItem
public int addTableItem(PamTableItem pamTableItem)
pamTableItem
- new table item object.If an item already exists with the same name (after deblanking) the new table item will not be added to the list and the index of the existing table item will be returned.
public PamTableItem removeTableItem(int itemIndex)
itemIndex
- index of the table item.public boolean removeTableItem(PamTableItem item)
item
- reference to the item to be removed.public PamTableItem findTableItem(java.lang.String itemName)
itemName
- public PamTableItem findTableItem(PamTableItem tableItem)
tableItem
- public java.lang.String getSQLInsertString(SQLTypes sqlTypes)
If skipCounters is true, then counters are not included in the statement. Generally, this is the sensible ting to do.
public java.lang.String getSQLSelectString(SQLTypes sqlTypes)
public final java.lang.String getBasicSelectString(SQLTypes sqlTypes)
public boolean unpackResultSet(java.sql.ResultSet resultSet)
resultSet
- result set to unpackpublic PamTableItem getIndexItem()
public boolean isUseCheatIndexing()
This could go badly wrong if more than one program or different bits of the same programme are writing to the same table. However, in many cases this will not be important since the indexes are not actually used in real time operation. i.e. it's safe to do this for things like GPS and whistle data. However, it would not be recommended for things where it's more likely that multiple users might write to the same database or where indexing is really critical such as in logger forms (the index is used to update data) or Click offline events (the index is used for cross referencing from the clicks).
public void setUseCheatIndexing(boolean useCheatIndexing)
This could go badly wrong if more than one program or different bits of the same programme are writing to the same table. However, in many cases this will not be important since the indexes are not actually used in real time operation. i.e. it's safe to do this for things like GPS and whistle data. However, it would not be recommended for things where it's more likely that multiple users might write to the same database or where indexing is really critical such as in logger forms (the index is used to update data) or Click offline events (the index is used for cross referencing from the clicks).
useCheatIndexing
- the useCheatIndexing to set