Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Schema class. More...
#include <ilviews/dataccess/tbldef.h>
Public Member Functions | |
IliSQLTableDef (IlvDisplay *display, IL_STDPREF istream &input) | |
This constructor initializes an SQL table definition by reading from an input stream. | |
IliSQLTableDef (const IliSQLTableDef &) | |
This is the copy constructor of class IliSQLTableDef . | |
IliSQLTableDef (IlvDisplay *display) | |
This constructor initializes an SQL table definition. | |
void | appendCandidateKey () |
Appends a new candidate key at the end of all existing candidate keys. | |
void | appendForeignKey (const IliSQLTableRef &ref) |
Appends a new foreign key at the end of the existing foreign keys. | |
IlInt | getCandidateKeysCount () const |
Returns the number of candidate keys. | |
const char * | getColumnForeignColumn (IlInt colno, IlInt fkno) const |
Returns the name of the foreign table column, which the column corresponds to, in the foreign key. | |
IlInt | getColumnPrecision (IlInt colno) const |
Returns the precision of one column. | |
IlInt | getColumnScale (IlInt colno) const |
Returns the scale of the column. | |
const char * | getColumnSQLDefault (IlInt colno) const |
Returns the SQL default value of one column. | |
const char * | getColumnSQLType (IlInt colno) const |
Returns the name of the SQL type for one column. | |
IlInt | getCreateStatementsCount (IliSQLSession *session) const |
Returns the number of SQL statements needed to create the table defined by the IliSQLTableDef object. | |
IlInt | getForeignKeysCount () const |
Returns the number of foreign keys defined for the object. | |
const IliSQLTableRef & | getForeignKeyTable (IlInt fkno) const |
Returns the foreign table reference of the foreign key. | |
const IliSQLTableRef & | getTableRef () const |
Returns SQL table reference of the SQL table definition. | |
void | insertCandidateKey (IlInt ckno) |
Inserts a new candidate key. | |
void | insertForeignKey (IlInt fkno, const IliSQLTableRef &ref) |
Inserts a new foreign key. | |
IlBoolean | isABaseTable () const |
Returns IlTrue if the SQL table definition is a base table on the remote database. | |
IlBoolean | isAView () const |
Returns IlTrue if the SQL table definition is a view on the remote database. | |
IlBoolean | isColumnPartOfCandidateKey (IlInt colno, IlInt ckno) const |
Returns IlTrue if the column is part of one candidate key. | |
IlBoolean | isColumnPartOfForeignKey (IlInt colno, IlInt fkno) const |
Returns IlTrue if the column is part of the foreign key. | |
IlBoolean | makeCreateStatement (IliSQLSession *session, IlInt index, IliString &stmt, IliErrorMessage &msg) const |
Writes one of the SQL statements needed to create the table on the remote database. | |
void | normalizeKeys () |
Removes any redundant candidate key. | |
void | removeCandidateKey (IlInt ckno) |
Removes the candidate key at position ckno . | |
void | removeForeignKey (IlInt fkno) |
Removes the foreign key. | |
void | setAsView (IlBoolean f) |
Determines if the SQL table definition is a view on the remote database. | |
void | setColumnForeignColumn (IlInt colno, IlInt fkno, const char *name) |
Sets the name of the foreign column, referenced by the foreign key. | |
void | setColumnPartOfCandidateKey (IlInt colno, IlInt ckno, IlBoolean f) |
Specifies if the column is part of one candidate key. | |
void | setColumnPartOfForeignKey (IlInt colno, IlInt fkno, IlBoolean f) |
Specifies if the column is part of the foreign key. | |
void | setColumnPrecision (IlInt colno, IlInt precision) |
Sets the precision of one column. | |
void | setColumnScale (IlInt colno, IlInt scale) |
Sets the scale of the column. | |
void | setColumnSQLDefault (IlInt colno, const char *def) |
Sets the SQL default value of one column. | |
void | setColumnSQLType (IlInt colno, const char *type) |
Sets the SQL type name of one column. | |
void | setForeignKeyTable (IlInt fkno, const IliSQLTableRef &) |
Sets the foreign table reference of the foreign key. | |
void | setTableRef (const IliSQLTableRef &ref) |
Sets the SQL table reference. | |
virtual void | write (IL_STDPREF ostream &output) const |
Writes the definition of an IliSQLTableDef object to an output stream, in a form suitable for reading back with the stream-based constructor. | |
Friends | |
class | IliSQLSession |
Schema class.
Library: dataccess
The IliSQLTableDef
class defines the structure of a table stored in a remote relational database. Note that the IliSQLTableDef
class does not encapsulate the notion of rows, it only defines the schema of an SQL table.
IliSQLTableDef::IliSQLTableDef | ( | IlvDisplay * | display | ) |
This constructor initializes an SQL table definition.
Initially, this object is empty.
display | The display. |
IliSQLTableDef::IliSQLTableDef | ( | IlvDisplay * | display, | |
IL_STDPREF istream & | input | |||
) |
This constructor initializes an SQL table definition by reading from an input stream.
display | The display. | |
input | The input stream. |
void IliSQLTableDef::appendForeignKey | ( | const IliSQLTableRef & | ref | ) |
Appends a new foreign key at the end of the existing foreign keys.
ref | The foreign key parameters. |
IlInt IliSQLTableDef::getCandidateKeysCount | ( | ) | const |
Returns the number of candidate keys.
Returns the name of the foreign table column, which the column corresponds to, in the foreign key.
colno | The column position. | |
fkno | The foreign key position. |
Returns the precision of one column.
colno | The column position. |
Returns the scale of the column.
colno | The column position. |
const char* IliSQLTableDef::getColumnSQLDefault | ( | IlInt | colno | ) | const |
Returns the SQL default value of one column.
colno | The column position. |
const char* IliSQLTableDef::getColumnSQLType | ( | IlInt | colno | ) | const |
Returns the name of the SQL type for one column.
The SQL type name is dependent on the database system that the table is stored on.
colno | The column position. |
NULL
if the position is out of bounds. IlInt IliSQLTableDef::getCreateStatementsCount | ( | IliSQLSession * | session | ) | const |
Returns the number of SQL statements needed to create the table defined by the IliSQLTableDef
object.
session | The session which is connected to the remote database. |
IliSQLTableDef
object. IlInt IliSQLTableDef::getForeignKeysCount | ( | ) | const |
Returns the number of foreign keys defined for the object.
const IliSQLTableRef& IliSQLTableDef::getForeignKeyTable | ( | IlInt | fkno | ) | const |
Returns the foreign table reference of the foreign key.
fkno | The position. |
const IliSQLTableRef& IliSQLTableDef::getTableRef | ( | ) | const |
Returns SQL table reference of the SQL table definition.
An SQL table reference specifies the name of a table, along with the name of the owner of the table.
void IliSQLTableDef::insertCandidateKey | ( | IlInt | ckno | ) |
Inserts a new candidate key.
ckno | The position. |
void IliSQLTableDef::insertForeignKey | ( | IlInt | fkno, | |
const IliSQLTableRef & | ref | |||
) |
Inserts a new foreign key.
fkno | The insertion position. | |
ref | The foreign key parameters. |
IlBoolean IliSQLTableDef::isABaseTable | ( | ) | const |
Returns IlTrue
if the SQL table definition is a base table on the remote database.
IlTrue
if the SQL table definition is a base table on the remote database. IlBoolean IliSQLTableDef::isAView | ( | ) | const |
Returns IlTrue
if the SQL table definition is a view on the remote database.
IlTrue
if the SQL table definition is a view on the remote database. Returns IlTrue
if the column is part of one candidate key.
colno | The column position. | |
ckno | The key position. |
IlTrue
if the column is part of the candidate key. Returns IlTrue
if the column is part of the foreign key.
colno | The column position. | |
fkno | The foreign key position. |
IlTrue
if the column is part of the foreign key. IlBoolean IliSQLTableDef::makeCreateStatement | ( | IliSQLSession * | session, | |
IlInt | index, | |||
IliString & | stmt, | |||
IliErrorMessage & | msg | |||
) | const |
Writes one of the SQL statements needed to create the table on the remote database.
session | The session which is connected to the remote database. | |
index | The statements are to be written. | |
stmt | The SQL statements. | |
msg | The error message if an error occurs. |
IlTrue
if successful. void IliSQLTableDef::normalizeKeys | ( | ) |
Removes any redundant candidate key.
This member function will optimize the set of the candidate keys and the primary key of the object to ensure that:
It also selects the smallest candidate key to serve as a primary key.
void IliSQLTableDef::removeCandidateKey | ( | IlInt | ckno | ) |
Removes the candidate key at position ckno
.
ckno | The position. |
void IliSQLTableDef::removeForeignKey | ( | IlInt | fkno | ) |
Removes the foreign key.
fkno | The position. |
void IliSQLTableDef::setAsView | ( | IlBoolean | f | ) |
Determines if the SQL table definition is a view on the remote database.
f | If IlTrue , the SQL table definition is a view on the remote database. |
Sets the name of the foreign column, referenced by the foreign key.
The name is set to a copy.
colno | The column position. | |
fkno | The foreign key position. | |
name | The column name. |
Specifies if the column is part of one candidate key.
colno | The column position. | |
ckno | The key position. | |
f | If IlTrue , the column is part of the candidate key. |
Specifies if the column is part of the foreign key.
colno | The column position. | |
fkno | The foreign key position. | |
f | If IlTrue , the column is part of the foreign key. |
Sets the precision of one column.
colno | The column position. | |
precision | The precision. |
Sets the scale of the column.
colno | The column position. | |
scale | The scale. |
void IliSQLTableDef::setColumnSQLDefault | ( | IlInt | colno, | |
const char * | def | |||
) |
Sets the SQL default value of one column.
colno | The column position. | |
def | The SQL default. |
void IliSQLTableDef::setColumnSQLType | ( | IlInt | colno, | |
const char * | type | |||
) |
Sets the SQL type name of one column.
colno | The column position. | |
type | The SQL type. |
void IliSQLTableDef::setForeignKeyTable | ( | IlInt | fkno, | |
const IliSQLTableRef & | ||||
) |
Sets the foreign table reference of the foreign key.
fkno | The foreign key position. | |
ref | The foreign key parameters. |
void IliSQLTableDef::setTableRef | ( | const IliSQLTableRef & | ref | ) |
Sets the SQL table reference.
ref | The new SQL table reference. |
virtual void IliSQLTableDef::write | ( | IL_STDPREF ostream & | output | ) | const [virtual] |
Writes the definition of an IliSQLTableDef
object to an output stream, in a form suitable for reading back with the stream-based constructor.
output | The output stream. |
Reimplemented from IliSchema.
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.