#include <Relation.h>
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. |
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!
Definition at line 45 of file Relation.h.
Relation::Relation | ( | TableImplPtr | table | ) |
Construct a new Relation object for the specified table.
Relation::~Relation | ( | ) |
Destructor, a noop.
TableImplPtr Relation::getTable | ( | ) | [inline] |
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.