WORM 0.2
A C++ DAL/ORM code generation framework

src/sql/wsqlforeignkey.h

Go to the documentation of this file.
00001 /*
00002     WORM - a DAL/ORM code generation framework
00003     Copyright (C) 2011  Erik Winn <sidewalksoftware@gmail.com>
00004 
00005     This program is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 
00020 #ifndef WSQLFOREIGNKEY_H
00021 #define WSQLFOREIGNKEY_H
00022 
00023 #include <string>
00024 
00025 namespace WSql{
00026     
00027 class WSqlForeignKey
00028 {
00029 
00030     public:
00031         WSqlForeignKey();
00032         WSqlForeignKey( const WSqlForeignKey& other );
00033         virtual ~WSqlForeignKey();
00034         virtual WSqlForeignKey& operator=( const WSqlForeignKey& other );
00035         virtual bool operator==( const WSqlForeignKey& other ) const;
00036         inline bool operator!=( const WSqlForeignKey& other ) const {
00037             return !operator==( other );
00038         }
00039         
00040         void setKeyName(std::string name){_keyName=name;}
00041         void setTableName(std::string name){_tableName=name;}
00042         void setSchemaName(std::string name){_schemaName=name;}
00043         void setColumnName(std::string name){_columnName=name;}
00044         void setReferencedTableName(std::string name){_referencedTableName=name;}
00045         void setReferencedColumnName(std::string name){_referencedColumnName=name;}
00046         void setReferencedSchemaName(std::string name){_referencedSchemaName=name;}
00047         const std::string& keyName()const{return _keyName;}
00048         const std::string& tableName()const{return _tableName;}
00049         const std::string& schemaName()const{return _schemaName;}
00050         const std::string& columnName()const{return _columnName;}
00051         const std::string& referencedColumnName()const{return _referencedColumnName;}
00052         const std::string& referencedTableName()const{return _referencedTableName;}
00053         const std::string& referencedSchemaName()const{return _referencedSchemaName;}
00054         
00055         std::string referencedClassName() const;
00056         std::string referencedClassNamePlural() const;
00057         
00058         void dump()const;
00059     private:
00060         std::string _keyName;
00061         std::string _columnName;
00062         std::string _tableName;
00063         std::string _schemaName;
00064         std::string _referencedTableName;
00065         std::string _referencedColumnName;
00066         std::string _referencedSchemaName;
00067 };
00068 
00069 }//namespace WSql
00070 #endif // WSQLFOREIGNKEY_H
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Defines