Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

cManyToManyRelationBase.h

Go to the documentation of this file.
00001 /******************************************************************************/
00002 /*                                                                            */
00003 /* POLiTe - Persistent Object Library Test                                    */
00004 /*                                        Ph.D. Thesis by Mgr. Michal Kopecky */
00005 /*                                                                            */
00006 /* Charles University Prague                                                  */
00007 /*                                                                            */
00008 /******************************************************************************/
00009 /*                                                                            */
00010 /* File name: ...                                                             */
00011 /* Module: ......                                                             */
00012 /*                                                                            */
00013 /******************************************************************************/
00014 
00015 #ifndef __C_MANYTOMANYRELATIONBASE_H__
00016 #define __C_MANYTOMANYRELATIONBASE_H__
00017 
00018 // Parent Header(s)
00019 #include <cRelation.h>
00020 
00021 class DLL_External ManyToManyRelationBase : public Relation {
00022 #ifdef POLITE_TEST_FRIEND
00023         friend POLITE_TEST_FRIEND;
00024 #endif // POLITE_TEST_FRIEND
00025 
00026 public:
00027         ManyToManyRelationBase(
00028                 const char *a_left_class_name,
00029                 const char *a_right_class_name,
00030                 const char *a_table_name,
00031                 class Connection *a_database_connection,
00032                 const char *a_left_column_name = NULL,
00033                 const char *a_right_column_name = NULL
00034                 );
00035 
00036         virtual bool InsertCouple(RefBase &left, RefBase &right);
00037         //Inserts a couple <L, R> to the OMT-relation.
00038 
00039         virtual bool DeleteCouple(RefBase &left, RefBase &right);
00040         //Deletes a couple <L, R> from the OMT-relation.
00041 
00042         virtual bool LDeleteAll(class RefBase &right);
00043         //Deletes all couples <X, right>
00044 
00045         virtual bool RDeleteAll(class RefBase &left);
00046         //Deletes all couples <left, X>
00047 
00048         virtual bool WriteDDL(ofstream &S, class Database &Db);
00049         // generates DDL stements nedded for the library to run
00050 
00051 protected:
00052         virtual class ResultBase *_LGetAll(
00053                 ResultBase *rb,
00054                 const class RefBase &right,
00055                 const class QueRefProto &query = EQUERY
00056                 );
00057         //Gets all objects connected to object "right"
00058         //according to "query"
00059 
00060         virtual ResultBase *_RGetAll(
00061                 ResultBase *rb,
00062                 const class RefBase &left,
00063                 const class QueRefProto &query = EQUERY
00064                 );
00065         //Gets all objects connected to object "left"
00066         //according to "query"
00067 
00068 public:
00069         virtual bool ExistsCouple(
00070                 const class RefBase &left,
00071                 const class RefBase &right
00072         );
00073         //Tests if exists relation between the given objects
00074 
00075 /*
00076         ManyToManyRelationBase operator -() const;
00077         //Returns inverse relation
00078 */
00079 
00080         ManyToManyRelationBase(const ManyToManyRelationBase &R):
00081         Relation(
00082                 R._leftClassName,
00083                 R._rightClassName,
00084                 R._tableName,
00085                 R._databaseConnection,
00086                 R._leftColumnName,
00087                 R._rightColumnName
00088                 ) {};
00089         //Deep copy-constructor
00090 
00091 /*
00092         ManyToManyRelationBase &operator =(const ManyToManyRelationBase &const R);
00093         //Returns copy of relation
00094 */
00095 };
00096 
00097 #endif //__C_MANYTOMANYRELATIONBASE_H__

Generated on Sun Jul 14 20:51:14 2002 for POLiTe by doxygen1.2.16