Class Table
- java.lang.Object
-
- edu.uiuc.ncsa.security.storage.sql.internals.Table
-
- Direct Known Subclasses:
ClientTable
,MonitoredTable
public abstract class Table extends Object
Top-level class for modeling SQL tables that have a single, unique key and can be modelled as maps of java objects. Each row in the table corresponds to a java object. The primary key is the key in the map. This class represents the bridge between java and SQL. Normally you must only implement thecreateColumnDescriptors()
method to get all creation (yes! management too!!), inserts and updates automagically taken care of.Created by Jeff Gaynor
on Apr 13, 2010 at 2:04:54 PM
-
-
Field Summary
Fields Modifier and Type Field Description protected ColumnDescriptors
columnDescriptor
protected SerializationKeys
keys
protected String
tablename
-
Constructor Summary
Constructors Constructor Description Table(SerializationKeys keys, String schema, String tablenamePrefix, String tablename)
The schema and prefix are not part of the table's information, actually, but are needed to create its fully qualified name in context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createColumnDescriptors()
Invoked to create all the descriptors for this table.String
createInsertStatement()
Creates a new insert statement with every column.String
createMassInsertStatement()
String
createRegisterStatement()
String
createSelectAllStatement()
Returns the select statement for this table with one parameter for the primary key.String
createSelectStatement()
Returns the select statement for this table with one parameter for the primary key.String
createTableStatement()
String
createUpdateStatement()
An update statement has all columns, except, the primary key, which is used to create the where clause.protected String
fqTablename(String name)
ColumnDescriptors
getColumnDescriptor()
ColumnTypeTranslator
getColumnTypeTranslator()
String
getCreateTableStatement()
String
getFQTablename()
String
getPrimaryKeyColumnName()
String
getSchema()
String
getTablename()
String
getTablenamePrefix()
void
setTablename(String tablename)
void
setTablenamePrefix(String tablenamePrefix)
String
toString()
-
-
-
Field Detail
-
keys
protected SerializationKeys keys
-
tablename
protected String tablename
-
columnDescriptor
protected ColumnDescriptors columnDescriptor
-
-
Constructor Detail
-
Table
public Table(SerializationKeys keys, String schema, String tablenamePrefix, String tablename)
The schema and prefix are not part of the table's information, actually, but are needed to create its fully qualified name in context. Hence they must be supplied.- Parameters:
keys
-schema
-tablenamePrefix
-tablename
-
-
-
Method Detail
-
getFQTablename
public String getFQTablename()
-
getTablename
public String getTablename()
-
setTablename
public void setTablename(String tablename)
-
createColumnDescriptors
public void createColumnDescriptors()
Invoked to create all the descriptors for this table.
-
getColumnDescriptor
public ColumnDescriptors getColumnDescriptor()
-
getCreateTableStatement
public String getCreateTableStatement()
-
getPrimaryKeyColumnName
public String getPrimaryKeyColumnName()
-
getColumnTypeTranslator
public ColumnTypeTranslator getColumnTypeTranslator()
-
createTableStatement
public String createTableStatement()
-
createSelectStatement
public String createSelectStatement()
Returns the select statement for this table with one parameter for the primary key.- Returns:
-
createSelectAllStatement
public String createSelectAllStatement()
Returns the select statement for this table with one parameter for the primary key.- Returns:
-
createRegisterStatement
public String createRegisterStatement()
-
getTablenamePrefix
public String getTablenamePrefix()
-
getSchema
public String getSchema()
-
setTablenamePrefix
public void setTablenamePrefix(String tablenamePrefix)
-
createUpdateStatement
public String createUpdateStatement()
An update statement has all columns, except, the primary key, which is used to create the where clause.- Returns:
-
createInsertStatement
public String createInsertStatement()
Creates a new insert statement with every column. This is used in theSQLStore.register(Identifiable)
call, e.g.- Returns:
-
createMassInsertStatement
public String createMassInsertStatement()
-
-