generalDatabase
Class PamTableDefinition

java.lang.Object
  extended by generalDatabase.EmptyTableDefinition
      extended by generalDatabase.PamTableDefinition
Direct Known Subclasses:
PamSettingsTableDefinition

public class PamTableDefinition
extends EmptyTableDefinition

Defines a database table for use with the Pamguard database The Pamguard database can query this table definition to see what columns should be present and to create appropriate tables. Also used to prepare Sql statements for writing and reading back data.

Author:
Doug Gillespie
See Also:
PamTableItem, pamDatabase.DatabaseProcess

Field Summary
private  PamTableItem localTimeItem
           
private  java.lang.String preparedSelectString
           
private  PamTableItem timeStampItem
           
private  PamTableItem timeStampMillis
           
private  PamTableItem updateReference
           
 
Fields inherited from class generalDatabase.EmptyTableDefinition
checkedConnection, pamTableItems, tableName
 
Constructor Summary
PamTableDefinition(java.lang.String tableName, int updatePolicy)
           
 
Method Summary
 java.lang.String getBetweenString(PamViewParameters pvp)
          Get the where clause for Viewer SQL statements.
 java.sql.Connection getCheckedConnection()
           
 PamTableItem getLocalTimeItem()
           
 java.lang.String getSQLSelectString()
          Get a very basic select string which queries for all items in the table, no ordering or selection
 java.lang.String getSQLSelectString(PamViewParameters pamViewParameters)
          gets an sql select string for the table that selects all fields.
 PamTableItem getTimeStampItem()
           
 PamTableItem getTimeStampMillis()
           
 PamTableItem getUpdateReference()
           
 void setCheckedConnection(java.sql.Connection checkedConnection)
           
 void setUpdateReference(PamTableItem updateReference)
           
 
Methods inherited from class generalDatabase.EmptyTableDefinition
addTableItem, deblankString, findTableDefinition, findTableItem, findTableItem, getIndexItem, getSQLInsertString, getTableItem, getTableItemCount, getTableName, removeTableItem, removeTableItem, setTableName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeStampItem

private PamTableItem timeStampItem

timeStampMillis

private PamTableItem timeStampMillis

localTimeItem

private PamTableItem localTimeItem

updateReference

private PamTableItem updateReference

preparedSelectString

private java.lang.String preparedSelectString
Constructor Detail

PamTableDefinition

public PamTableDefinition(java.lang.String tableName,
                          int updatePolicy)
Parameters:
tableName - Name of the database table. Spaces in the database name will automatically be replaced by the _ character.
Method Detail

getSQLSelectString

public java.lang.String getSQLSelectString()
Description copied from class: EmptyTableDefinition
Get a very basic select string which queries for all items in the table, no ordering or selection

Overrides:
getSQLSelectString in class EmptyTableDefinition
Returns:
an SQL string.

getSQLSelectString

public java.lang.String getSQLSelectString(PamViewParameters pamViewParameters)
gets an sql select string for the table that selects all fields. Note that some databases don't support the " around a column name, so this has been omitted, making it impossible to use fields with spaces.

Returns:
SQL Select string

getBetweenString

public java.lang.String getBetweenString(PamViewParameters pvp)
Get the where clause for Viewer SQL statements.

Parameters:
pvp -
Returns:
clause string

getTimeStampItem

public PamTableItem getTimeStampItem()

getTimeStampMillis

public PamTableItem getTimeStampMillis()

getLocalTimeItem

public PamTableItem getLocalTimeItem()

getCheckedConnection

public java.sql.Connection getCheckedConnection()

setCheckedConnection

public void setCheckedConnection(java.sql.Connection checkedConnection)

getUpdateReference

public PamTableItem getUpdateReference()

setUpdateReference

public void setUpdateReference(PamTableItem updateReference)