OOFILE  1.9
Public Member Functions | List of all members
dbRelationship Class Reference

Object used to specify relationship between two dbTable instances. More...

#include <oofrel.h>

Public Member Functions

 dbRelationship (dbRelRefBase &, dbRelRefBase &)
 
 dbRelationship (dbRelRefBase *, dbRelRefBase *)
 
 dbRelationship (dbRelRefBase &, dbRelRefBase &, dbField &, dbField &)
 
 dbRelationship (dbRelRefBase *, dbRelRefBase *, dbField *, dbField *)
 
void linkMNvia (dbRelRefBase &, dbRelRefBase &)
 Finish specifying an M:N relationship by pointing out from middle table to both sides. More...
 
void linkMNvia (dbRelRefBase *, dbRelRefBase *)
 

Detailed Description

Object used to specify relationship between two dbTable instances.

Simple relationships just use dbRelationship as a functor. In cases like M:N relationships we need to create a named dbRelationship to call additional specification methods like linkMNvia();

Todo:
factor into mixin, but our OOF_mixRefCount has different semantics expecting at least one ref

Definition at line 154 of file oofrel.h.

Constructor & Destructor Documentation

dbRelationship::dbRelationship ( dbRelRefBase lhs,
dbRelRefBase rhs 
)

Definition at line 1236 of file oofrel.cpp.

References dbRelRefBase::relatesTo().

dbRelationship::dbRelationship ( dbRelRefBase lhs,
dbRelRefBase rhs 
)

Definition at line 1244 of file oofrel.cpp.

References dbRelRefBase::relatesTo().

dbRelationship::dbRelationship ( dbRelRefBase lhs,
dbRelRefBase rhs,
dbField lhsJoin,
dbField rhsJoin 
)

Definition at line 1252 of file oofrel.cpp.

References dbRelRefBase::joinField(), and dbRelRefBase::relatesTo().

dbRelationship::dbRelationship ( dbRelRefBase lhs,
dbRelRefBase rhs,
dbField lhsJoin,
dbField rhsJoin 
)

Definition at line 1262 of file oofrel.cpp.

References dbRelRefBase::joinField(), and dbRelRefBase::relatesTo().

Member Function Documentation

void dbRelationship::linkMNvia ( dbRelRefBase lhsLink,
dbRelRefBase rhsLink 
)

Finish specifying an M:N relationship by pointing out from middle table to both sides.

Assumes a pair of 1:N relationships have been created from the left and right tables to the middle table which maps the M:N. We can create an M:N link directly between the left and right tables usng a dbRelationship but need to not only specify the end-points but also the middle via linkMNvia().

Definition at line 1280 of file oofrel.cpp.

References dbField::fieldTable(), dbConnect::raise(), dbRelRefBase::setMNlink(), and dbTable::tableName().

Referenced by linkMNvia().

void dbRelationship::linkMNvia ( dbRelRefBase lhsLink,
dbRelRefBase rhsLink 
)

Definition at line 1326 of file oofrel.cpp.

References linkMNvia().


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