2
The contents of this file are subject to the Initial Developer's Public
3
License Version 1.0 (the "License"); you may not use this file except in
4
compliance with the License. You may obtain a copy of the License here:
5
http://www.flamerobin.org/license.html.
7
Software distributed under the License is distributed on an "AS IS"
8
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
9
License for the specific language governing rights and limitations under
12
The Original Code is FlameRobin (TM).
14
The Initial Developer of the Original Code is Milan Babuskov.
16
Portions created by the original developer
17
are Copyright (C) 2004 Milan Babuskov.
24
#ifndef FR_CONSTRAINTS_H
25
#define FR_CONSTRAINTS_H
29
#include "metadataitem.h"
30
//------------------------------------------------------------------------------
31
// These could all be simple "struct"s but we want to add some functionality later
33
class Constraint: public YxMetadataItem
35
// nothing needed yet, but it may be once
37
//------------------------------------------------------------------------------
38
//! primary keys and uniques
39
class ColumnConstraint: public Constraint
42
typedef std::vector<std::string>::const_iterator const_iterator;
43
//std::string indexName; needed?
44
std::vector<std::string> columnsM;
46
std::string getColumnList() const;
47
const_iterator begin() { return columnsM.begin(); };
48
const_iterator end() { return columnsM.end(); };
50
//------------------------------------------------------------------------------
52
class CheckConstraint: public Constraint
57
//------------------------------------------------------------------------------
59
class ForeignKey: public ColumnConstraint
62
std::string referencedTableM; // referenced table
63
std::vector<std::string> referencedColumnsM; // referenced columns
64
std::string updateActionM;
65
std::string deleteActionM;
66
std::string getReferencedColumnList() const;
68
//------------------------------------------------------------------------------