Relation Class Reference

This class may be used to easily create a new relation. More...

#include <Relation.h>

List of all members.

Public Member Functions

 Relation (TableImplPtr table)
 Construct a new Relation object for the specified table.
 ~Relation ()
 Destructor, a noop.
TableImplPtr getTable ()
 Returns the relational table this Relation belongs to.
void addKey (KeyImplPtr key, value_type value)
 Add a key from the specified field with the specified value.
void addField (FieldImplPtr field, value_type value)
 Add a value from the specified field with the specified value.
void addField (FieldImplPtr field, cstring value)
 Add a value from the specified field with the specified value.
void save ()
 Save the Relation to the database.


Detailed Description

This class may be used to easily create a new relation.

Using this class a new entry in a relational table is made. This entry connects two rows in the different tables the relational table refers to. Keys may be added throug the addKey function. Fields within the relational table may be set with the addField method. When the relation is fully specified the entry may be added with the save method. Note: save may only be called once!

See also:
addKey

addField

save

Definition at line 45 of file Relation.h.


Constructor & Destructor Documentation

Relation::Relation ( TableImplPtr  table  ) 

Construct a new Relation object for the specified table.

Relation::~Relation (  ) 

Destructor, a noop.


Member Function Documentation

TableImplPtr Relation::getTable (  )  [inline]

Returns the relational table this Relation belongs to.

Definition at line 56 of file Relation.h.

void Relation::addKey ( KeyImplPtr  key,
value_type  value 
)

Add a key from the specified field with the specified value.

void Relation::addField ( FieldImplPtr  field,
value_type  value 
)

Add a value from the specified field with the specified value.

void Relation::addField ( FieldImplPtr  field,
cstring  value 
)

Add a value from the specified field with the specified value.

void Relation::save (  ) 

Save the Relation to the database.


Generated for UnsignedByte by  doxygen 1.5.3
SourceForge.net Logo