te::da::Join Class Referenceabstract

A Join clause combines two FromItems. More...

#include <Join.h>

Inheritance diagram for te::da::Join:
te::da::FromItem te::common::BaseVisitable< QueryVisitor >

Public Types

typedef void ReturnType
 
typedef QueryVisitor VisitorType
 

Public Member Functions

virtual ReturnType accept (VisitorType &guest) const =0
 It call the visit method from the guest object. More...
 
FromItemclone () const
 It creates a new copy of this FromItem. More...
 
const std::string & getAlias () const
 It returns the alias associated to the source item. More...
 
JoinConditiongetCondition () const
 It returns the join condition. More...
 
FromItemgetFirst () const
 It returns the first from item involved in the join. More...
 
FromItemgetSecond () const
 It returns the second item involved in the join. More...
 
JoinType getType () const
 It returns the join type. More...
 
bool isNatural () const
 It tells if the join is Natural. More...
 
TE_DEFINE_VISITABLE Join (FromItem *first, FromItem *second, JoinType t, JoinCondition *c)
 Constructor. More...
 
 Join (const FromItem &first, const FromItem &second, JoinType t, const JoinCondition &c)
 Constructor. More...
 
 Join (const Join &rhs)
 Copy constructor. More...
 
Joinoperator= (const Join &rhs)
 
void setAlias (const std::string &alias)
 It sets the alias for a from source item. More...
 
void setCondition (JoinCondition *c)
 It sets the join condition. More...
 
void setFirst (FromItem *item)
 It sets first item involved in the join. More...
 
void setNatural (bool n)
 It marks if the join is a natural join. More...
 
void setSecond (FromItem *item)
 It sets second item involved in the join. More...
 
void setType (JoinType t)
 It sets join type. More...
 
 ~Join ()
 Destructor. More...
 

Protected Attributes

std::string m_alias
 An alias for the output name. More...
 

Private Attributes

std::auto_ptr< JoinConditionm_condition
 The join condition. More...
 
std::auto_ptr< FromItemm_first
 The first item involved in the join. More...
 
bool m_isNatural
 Natural is a shorthand for a JoinConditionUsing list that mentions all columns in the two tables that have the same names. More...
 
std::auto_ptr< FromItemm_second
 The first item involved in the join. More...
 
JoinType m_type
 The join type. More...
 

Detailed Description

A Join clause combines two FromItems.

See also
FromItem, DataSetName, FromFunctionCall, SubSelect

Definition at line 50 of file Join.h.

Member Typedef Documentation

typedef void te::common::BaseVisitable< QueryVisitor , void >::ReturnType
inherited

Definition at line 58 of file BaseVisitable.h.

Definition at line 57 of file BaseVisitable.h.

Constructor & Destructor Documentation

TE_DEFINE_VISITABLE te::da::Join::Join ( FromItem first,
FromItem second,
JoinType  t,
JoinCondition c 
)

Constructor.

Parameters
firstThe first FromItem to be combined.
secondThe second FromItem to be combined.
tThe join type.
cThe join condition.
Note
The Join will take the ownership of the First, Second and JoinCondition.
te::da::Join::Join ( const FromItem first,
const FromItem second,
JoinType  t,
const JoinCondition c 
)

Constructor.

Parameters
firstThe first FromItem to be combined.
secondThe second FromItem to be combined.
tThe join type.
cThe join condition.
te::da::Join::Join ( const Join rhs)

Copy constructor.

te::da::Join::~Join ( )

Destructor.

Member Function Documentation

virtual ReturnType te::common::BaseVisitable< QueryVisitor , void >::accept ( VisitorType guest) const
pure virtualinherited

It call the visit method from the guest object.

Parameters
guestThe guest or visitor.
Returns
Any valid value define by the template type R.
FromItem* te::da::Join::clone ( ) const
virtual

It creates a new copy of this FromItem.

Implements te::da::FromItem.

const std::string& te::da::FromItem::getAlias ( ) const
inherited

It returns the alias associated to the source item.

Returns
The alias for the source item.
JoinCondition* te::da::Join::getCondition ( ) const

It returns the join condition.

Returns
The join condition.
FromItem* te::da::Join::getFirst ( ) const

It returns the first from item involved in the join.

Returns
The first item involved in the join.
FromItem* te::da::Join::getSecond ( ) const

It returns the second item involved in the join.

Returns
The second item involved in the join.
JoinType te::da::Join::getType ( ) const

It returns the join type.

Returns
The join type.
bool te::da::Join::isNatural ( ) const
inline

It tells if the join is Natural.

Returns
True if it is a Natural join, otherwise, false.

Definition at line 141 of file Join.h.

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

Assignment operator.

void te::da::FromItem::setAlias ( const std::string &  alias)
inherited

It sets the alias for a from source item.

Parameters
aliasThe alias for a from source item.
Note
The FromItem will take the ownership of the given alias.
void te::da::Join::setCondition ( JoinCondition c)

It sets the join condition.

Parameters
cThe join condition.
Note
The Join will take the ownership of the given condition.
void te::da::Join::setFirst ( FromItem item)

It sets first item involved in the join.

Parameters
itemThe first item involved in the join.
Note
The Join will take the ownership of the given item.
void te::da::Join::setNatural ( bool  n)
inline

It marks if the join is a natural join.

Parameters
nIf true this will be a natural join.

Definition at line 148 of file Join.h.

void te::da::Join::setSecond ( FromItem item)

It sets second item involved in the join.

Parameters
itemThe second item involved in the join.
Note
The Join will take the ownership of the given item.
void te::da::Join::setType ( JoinType  t)

It sets join type.

Parameters
tThe join type.

Member Data Documentation

std::string te::da::FromItem::m_alias
protectedinherited

An alias for the output name.

Definition at line 93 of file FromItem.h.

std::auto_ptr<JoinCondition> te::da::Join::m_condition
private

The join condition.

Definition at line 170 of file Join.h.

std::auto_ptr<FromItem> te::da::Join::m_first
private

The first item involved in the join.

Definition at line 168 of file Join.h.

bool te::da::Join::m_isNatural
private

Natural is a shorthand for a JoinConditionUsing list that mentions all columns in the two tables that have the same names.

Definition at line 172 of file Join.h.

std::auto_ptr<FromItem> te::da::Join::m_second
private

The first item involved in the join.

Definition at line 169 of file Join.h.

JoinType te::da::Join::m_type
private

The join type.

Definition at line 171 of file Join.h.


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