All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::da::CheckConstraint Class Reference

A class that describes a check constraint. More...

#include <CheckConstraint.h>

Inheritance diagram for te::da::CheckConstraint:
te::da::Constraint

Public Member Functions

 CheckConstraint (DataSetType *dt=0, unsigned int id=0)
 Constructor. More...
 
 CheckConstraint (const std::string &name, DataSetType *dt=0, unsigned int id=0)
 Constructor. More...
 
 CheckConstraint (const CheckConstraint &rhs)
 Copy constructor not allowed. More...
 
Constraintclone ()
 It returns a clone of the object. More...
 
virtual DataSetTypegetDataSetType () const
 It returns the DataSetType associated to the constraint. More...
 
const std::string & getExpression () const
 It returns the check constraint expression. More...
 
virtual unsigned int getId () const
 It returns the constraint identifier. More...
 
virtual const std::string & getName () const
 It returns the constraint name. More...
 
ConstraintType getType () const
 It returns the constraint type: CHECK. More...
 
CheckConstraintoperator= (const CheckConstraint &rhs)
 Assignment operator. More...
 
virtual void setDataSetType (DataSetType *dt)
 It sets the DataSetType associated to the constraint. More...
 
void setExpression (const std::string &e)
 It sets the check constraint expression. More...
 
virtual void setId (unsigned int id)
 It sets the constraint identifier. More...
 
virtual void setName (const std::string &name)
 It sets the constraint name. More...
 
 ~CheckConstraint ()
 Destructor. More...
 

Private Attributes

std::string m_expression
 The check constraint expression. More...
 

Detailed Description

A class that describes a check constraint.

See also
DataSetType, Constraint, PrimaryKey, UniqueKey, ForeignKey

Definition at line 46 of file CheckConstraint.h.

Constructor & Destructor Documentation

te::da::CheckConstraint::CheckConstraint ( DataSetType dt = 0,
unsigned int  id = 0 
)

Constructor.

Parameters
dtThe DataSetType associated to the check constraint.
idThe constraint identifier.
Note
The new constraint will belong to the given DataSetType.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!

Definition at line 31 of file CheckConstraint.cpp.

References te::da::DataSetType::add().

te::da::CheckConstraint::CheckConstraint ( const std::string &  name,
DataSetType dt = 0,
unsigned int  id = 0 
)

Constructor.

Parameters
nameThe check constraint name.
parentThe parent DataSetType of this check constraint.
idThe constraint identifier.
Note
The new constraint will belong to the given DataSetType.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!

Definition at line 38 of file CheckConstraint.cpp.

References te::da::DataSetType::add().

te::da::CheckConstraint::CheckConstraint ( const CheckConstraint rhs)

Copy constructor not allowed.

The new object will not have an associated DataSetType.

Parameters
rhsRight-hand-side instance.

Definition at line 47 of file CheckConstraint.cpp.

te::da::CheckConstraint::~CheckConstraint ( )
inline

Destructor.

Definition at line 87 of file CheckConstraint.h.

Member Function Documentation

te::da::Constraint * te::da::CheckConstraint::clone ( )
virtual

It returns a clone of the object.

The new object will not have an associated DataSetType.

Returns
A clone of the object.

Implements te::da::Constraint.

Definition at line 65 of file CheckConstraint.cpp.

virtual DataSetType* te::da::Constraint::getDataSetType ( ) const
inlinevirtualinherited

It returns the DataSetType associated to the constraint.

Returns
The DataSetType associated to the constraint.

Definition at line 133 of file Constraint.h.

Referenced by te::da::DataSourceCatalog::dropDependentFKs(), and te::da::DataSetType::remove().

const std::string& te::da::CheckConstraint::getExpression ( ) const
inline

It returns the check constraint expression.

Returns
The check constraint expression.

Definition at line 105 of file CheckConstraint.h.

Referenced by te::pgis::Transactor::addCheckConstraint(), and DSInfo::getCheckConstraintInfo().

virtual unsigned int te::da::Constraint::getId ( ) const
inlinevirtualinherited

It returns the constraint identifier.

Returns
A number that identifies the constraint.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!

Definition at line 103 of file Constraint.h.

ConstraintType te::da::CheckConstraint::getType ( ) const
inlinevirtual

It returns the constraint type: CHECK.

Returns
The constraint type CHECK.

Implements te::da::Constraint.

Definition at line 119 of file CheckConstraint.h.

References te::da::CHECK.

te::da::CheckConstraint & te::da::CheckConstraint::operator= ( const CheckConstraint rhs)

Assignment operator.

The new object will not have an assigned DataSetType.

Parameters
rhsRight-hand-side instance.
Returns
A reference to this.

Definition at line 53 of file CheckConstraint.cpp.

References m_expression, and te::da::Constraint::operator=().

virtual void te::da::Constraint::setDataSetType ( DataSetType dt)
inlinevirtualinherited

It sets the DataSetType associated to the constraint.

Parameters
dtThe DataSetType associated to this constraint.
Warning
Take care when calling this method. If the constraint belongs to a DataSetType, remember to detach it from the DataSetType before calling this method.

Definition at line 143 of file Constraint.h.

Referenced by te::da::DataSetType::add(), te::da::DataSetType::DataSetType(), and te::da::DataSetType::setPrimaryKey().

void te::da::CheckConstraint::setExpression ( const std::string &  e)
inline

It sets the check constraint expression.

Parameters
nameThe check constraint expression.

Definition at line 112 of file CheckConstraint.h.

Referenced by te::pgis::Transactor::getCheckConstraint(), te::ado::Transactor::getCheckConstraints(), and te::pgis::Transactor::getConstraints().

virtual void te::da::Constraint::setId ( unsigned int  id)
inlinevirtualinherited

It sets the constraint identifier.

Parameters
idA number that identifies the constraint.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!

Definition at line 112 of file Constraint.h.

Referenced by te::pgis::Transactor::getCheckConstraint(), and te::pgis::Transactor::getConstraints().

Member Data Documentation

std::string te::da::CheckConstraint::m_expression
private

The check constraint expression.

Definition at line 132 of file CheckConstraint.h.

Referenced by operator=().


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