UniqueConstraint Class Reference

Represents a uniqueness constraint on a table. More...

Inherits Simba::SQLEngine::TableConstraint.

List of all members.

Public Member Functions

virtual TableConstraintClone () const
 Retrieve a clone of this constraint.
virtual const UniqueConstraintGetAsUniqueConstraint () const
 Return this constraint as a UniqueConstraint object.
const std::vector< simba_uint16 > & GetUniqueColumns () const
 Get the vector of column indices included in this constraint.
 UniqueConstraint (const std::vector< simba_uint16 > &in_uniqueColumns)
 Constructor.
virtual ~UniqueConstraint ()
 Destructor.

Detailed Description

Represents a uniqueness constraint on a table.

This class is used in TableSpecification to define the unique constraints when creating a table. The constraint contains 1 or more columns that are defined in the same constraint.

Example SQL: CREATE TABLE tablename (col1 int, col2 int, UNIQUE(col1, col2)) This will generate 1 UniqueConstraint instance with 2 column indices.

CREATE TABLE tablename (col1 int, col2 int, UNIQUE(col1) UNIQUE(col2)) This will generate 2 UniqueConstraint instances with 1 column index each.


Constructor & Destructor Documentation

UniqueConstraint ( const std::vector< simba_uint16 > &  in_uniqueColumns  ) 

Constructor.

Parameters:
in_uniqueColumns The columns included in the constraint.
virtual ~UniqueConstraint (  )  [virtual]

Destructor.


Member Function Documentation

virtual TableConstraint* Clone (  )  const [virtual]

Retrieve a clone of this constraint.

Returns:
A clone of the constraint. (OWN)

Implements TableConstraint.

virtual const UniqueConstraint* GetAsUniqueConstraint (  )  const [virtual]

Return this constraint as a UniqueConstraint object.

Returns:
This constraint as a UniqueConstraint. (NOT OWN)

Reimplemented from TableConstraint.

const std::vector<simba_uint16>& GetUniqueColumns (  )  const

Get the vector of column indices included in this constraint.

Returns:
Reference to the vector of column indices.

The documentation for this class was generated from the following file:

Generated on Wed May 17 14:21:18 2017 for SimbaEngine 10.1.3.1011 by simba