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

src/sql/wsqlreferencedkey.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 WSQLREFERENCEDKEY_H
00021 #define WSQLREFERENCEDKEY_H
00022 #include <string>
00023 #include "wsqlforeignkey.h"
00024 
00025 namespace WSql{
00026     
00027 class WSqlReferencedKey
00028 {
00029 
00030 public:
00031     WSqlReferencedKey(const WSqlForeignKey &fk);
00032     WSqlReferencedKey(const WSqlReferencedKey& other);
00033     virtual ~WSqlReferencedKey();
00034     virtual WSqlReferencedKey& operator=(const WSqlReferencedKey& other);
00035     virtual bool operator==(const WSqlReferencedKey& other) const;
00036     inline bool operator!=( const WSqlReferencedKey& other ) const {
00037         return !operator==( other );
00038     }
00039     
00040     std::string referingClassName()const;
00041     std::string referingClassNamePlural()const;
00042     
00043     const std::string& columnName()const{return _referingKey.referencedColumnName();}
00044     const std::string& tableName()const{return _referingKey.referencedTableName();}
00045     const std::string& schemaName()const{return _referingKey.referencedSchemaName();}
00046     const std::string& referingKeyName()const{return _referingKey.keyName();}
00047     const std::string& referingColumnName()const{return _referingKey.columnName();}
00048     const std::string& referingTableName()const{return _referingKey.tableName();}
00049     const std::string& referingSchemaName()const{return _referingKey.schemaName();}
00050     
00051     void dump()const;
00052 private:
00053     WSqlForeignKey _referingKey;
00054     
00055 };
00056 
00057 }//namespace WSql
00058 #endif // WSQLREFERENCEDKEY_H
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Defines