jet.server.api.db
Interface Table

All Superinterfaces:
DBObject

public interface Table
extends DBObject

A Table is a data table in a database.


Method Summary
 int delete(FieldValue[] fields)
          Delete a record from the table.
 int delete(java.lang.String whereClause)
          Delete records from the table.
 Fields fields()
          Retrieves the fields container of this table.
 Field fields(int index)
          Gets the Field that specified by index.
 Field fields(java.lang.String fieldName)
          Gets the Field that specified by name.
 Database getDatabase()
          Retrieves Database of this table.
 java.lang.String getExternalDataPath(FieldValue[] fields)
          Gets the external data path of a record.
 boolean hasExternalData()
          Return whether the table has external data.
 int insert(FieldValue[] fields)
          Insert a record to the table
 int insert(java.util.List records)
          Insert multiple records to the table
 Recordset query(Field[] fields, java.lang.String whereClause, boolean distinct)
          Return a linked record set by specified columns and conditions.
 Recordset query(Field[] fields, java.lang.String whereClause, boolean distinct, int setType)
          Return a linked or a cached record set by specified columns and conditions.
 java.lang.Number queryAvgValue(java.lang.String field, java.lang.String whereClause, boolean distinct)
          Equals to "SELECT AVG (colName) FROM table WHERE.."
 int queryCountValue(java.lang.String field, java.lang.String whereClause, boolean distinct)
          Equals to "SELECT COUNT (colName) FROM table WHERE.."
 java.lang.Number queryMaxValue(java.lang.String field, java.lang.String whereClause, boolean distinct)
          Equals to "SELECT MAX (colName) FROM table WHERE.."
 java.lang.Number queryMinValue(java.lang.String field, java.lang.String whereClause, boolean distinct)
          Equals to "SELECT MIN (colName) FROM table WHERE.."
 java.lang.Number querySumValue(java.lang.String field, java.lang.String whereClause, boolean distinct)
          Equals to "SELECT SUM (colName) FROM table WHERE.."
 Uniques uniques()
          Retrieves the Unique container of this table.
 Unique uniques(int index)
          Retrieves the Unique that specified by the index.
 Unique uniques(java.lang.String unqName)
          Retrieves the Unique that specified by the name.
 int update(FieldValue[] fields, java.lang.String whereClause)
          Update records of the table.
 
Methods inherited from interface jet.server.api.db.DBObject
getName, getProperties, getProperty, getProperty, getUCName, setProperty
 

Method Detail

getDatabase

Database getDatabase()
Retrieves Database of this table.

Returns:
the Database instance.

fields

Fields fields()
Retrieves the fields container of this table.

Returns:
the Fields instance.
See Also:
Fields

fields

Field fields(int index)
Gets the Field that specified by index.

Parameters:
index - the field index.
Returns:
a Field instance.

fields

Field fields(java.lang.String fieldName)
Gets the Field that specified by name.

Parameters:
fieldName - the field name.
Returns:
a Field instance.

query

Recordset query(Field[] fields,
                java.lang.String whereClause,
                boolean distinct)
                throws java.sql.SQLException
Return a linked record set by specified columns and conditions.

Parameters:
fields - the columns want to retrieve.
whereClause - the sql where clause
distinct - the sql distinct
Returns:
a Recordset instance.
Throws:
java.sql.SQLException

query

Recordset query(Field[] fields,
                java.lang.String whereClause,
                boolean distinct,
                int setType)
                throws java.sql.SQLException
Return a linked or a cached record set by specified columns and conditions.

Parameters:
fields - the columns want to retrieve.
whereClause - the sql where clause
distinct - the sql distinct
setType - record set type, it should be one of jet.server.api.db.Recordset.LINKED or jet.server.api.db.Recordset.CACHED
Returns:
a Recordset instance.
Throws:
java.sql.SQLException

queryCountValue

int queryCountValue(java.lang.String field,
                    java.lang.String whereClause,
                    boolean distinct)
                    throws java.sql.SQLException
Equals to "SELECT COUNT (colName) FROM table WHERE.."

Parameters:
field -
whereClause -
distinct -
Returns:
Throws:
java.sql.SQLException

querySumValue

java.lang.Number querySumValue(java.lang.String field,
                               java.lang.String whereClause,
                               boolean distinct)
                               throws java.sql.SQLException
Equals to "SELECT SUM (colName) FROM table WHERE.."

Parameters:
field -
whereClause -
distinct -
Returns:
Throws:
java.sql.SQLException

queryAvgValue

java.lang.Number queryAvgValue(java.lang.String field,
                               java.lang.String whereClause,
                               boolean distinct)
                               throws java.sql.SQLException
Equals to "SELECT AVG (colName) FROM table WHERE.."

Parameters:
field -
whereClause -
distinct -
Returns:
Throws:
java.sql.SQLException

queryMaxValue

java.lang.Number queryMaxValue(java.lang.String field,
                               java.lang.String whereClause,
                               boolean distinct)
                               throws java.sql.SQLException
Equals to "SELECT MAX (colName) FROM table WHERE.."

Parameters:
field -
whereClause -
distinct -
Returns:
Throws:
java.sql.SQLException

queryMinValue

java.lang.Number queryMinValue(java.lang.String field,
                               java.lang.String whereClause,
                               boolean distinct)
                               throws java.sql.SQLException
Equals to "SELECT MIN (colName) FROM table WHERE.."

Parameters:
field -
whereClause -
distinct -
Returns:
Throws:
java.sql.SQLException

insert

int insert(FieldValue[] fields)
           throws java.sql.SQLException
Insert a record to the table

Parameters:
fields -
Returns:
Throws:
java.sql.SQLException

insert

int insert(java.util.List records)
           throws java.sql.SQLException
Insert multiple records to the table

Parameters:
records -
Returns:
Throws:
java.sql.SQLException

update

int update(FieldValue[] fields,
           java.lang.String whereClause)
           throws java.sql.SQLException
Update records of the table.

Parameters:
fields -
whereClause -
Returns:
Throws:
java.sql.SQLException

delete

int delete(java.lang.String whereClause)
           throws java.sql.SQLException
Delete records from the table.

Parameters:
whereClause -
Returns:
Throws:
java.sql.SQLException

delete

int delete(FieldValue[] fields)
           throws java.sql.SQLException
Delete a record from the table.

Parameters:
fields -
Returns:
Throws:
java.sql.SQLException

hasExternalData

boolean hasExternalData()
Return whether the table has external data.

Returns:

getExternalDataPath

java.lang.String getExternalDataPath(FieldValue[] fields)
Gets the external data path of a record.

Parameters:
fields -
Returns:

uniques

Uniques uniques()
Retrieves the Unique container of this table.

Returns:
the Uniques
See Also:
Uniques

uniques

Unique uniques(int index)
Retrieves the Unique that specified by the index.

Parameters:
index -
Returns:
the Unique

uniques

Unique uniques(java.lang.String unqName)
Retrieves the Unique that specified by the name.

Parameters:
unqName -
Returns:
the Unique