umbrello  2.34.3
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
foreignkeyconstraint.h
Go to the documentation of this file.
1 /*
2  SPDX-License-Identifier: GPL-2.0-or-later
3  SPDX-FileCopyrightText: 2002-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4 */
5 
6 #ifndef FOREIGNKEYCONSTRAINT_H
7 #define FOREIGNKEYCONSTRAINT_H
8 
9 // appl includes
10 #include "basictypes.h"
11 #include "entityconstraint.h"
12 
13 // qt includes
14 #include <QMap>
15 
16 //forward declarations
17 class UMLEntityAttribute;
18 class UMLEntity;
19 
28 {
29  Q_OBJECT
30 
31 public:
32 
42 
43  UMLForeignKeyConstraint(UMLObject *parent, const QString& name,
45  explicit UMLForeignKeyConstraint(UMLObject *parent);
46 
47  bool operator==(const UMLForeignKeyConstraint &rhs) const;
48 
49  virtual ~UMLForeignKeyConstraint();
50 
51  virtual void copyInto(UMLObject *lhs) const;
52 
53  virtual UMLObject* clone() const;
54 
56  bool withStereotype=false) const;
57 
58  void setReferencedEntity(UMLEntity* ent);
60 
61  void saveToXMI(QXmlStreamWriter& writer);
62 
63  virtual bool showPropertiesDialog(QWidget* parent = 0);
64 
66 
67  bool removeEntityAttributePair(UMLEntityAttribute* /*key*/ pAttr);
68 
70 
71  QMap<UMLEntityAttribute*, UMLEntityAttribute*> getEntityAttributePairs();
72 
75 
78 
79  void clearMappings();
80 
81  bool resolveRef();
82 
83 signals:
85 
86 private slots:
88 
89 protected:
90  bool load1(QDomElement & element);
91 
92 private:
93 
95 
101  QMap<UMLEntityAttribute*, Uml::ID::Type> m_pEntityAttributeIDMap;
102 
103  void init();
104 
106 
110  QMap<UMLEntityAttribute*, UMLEntityAttribute*> m_AttributeMap;
111 
114 };
115 
116 #endif
UMLForeignKeyConstraint::getUpdateAction
UpdateDeleteAction getUpdateAction() const
Definition: foreignkeyconstraint.cpp:424
UMLForeignKeyConstraint::m_DeleteAction
UpdateDeleteAction m_DeleteAction
What to do on Deletion of referenced attributes.
Definition: foreignkeyconstraint.h:113
UMLForeignKeyConstraint::UpdateDeleteAction
UpdateDeleteAction
Definition: foreignkeyconstraint.h:37
UMLObject::id
virtual Uml::ID::Type id() const
Definition: umlobject.cpp:421
UMLEntity
Non-graphical Information for an Entity.
Definition: entity.h:29
DEBUG_REGISTER
#define DEBUG_REGISTER(src)
Definition: debug_utils.h:129
UMLForeignKeyConstraint::load1
bool load1(QDomElement &element)
Definition: foreignkeyconstraint.cpp:268
UMLObject::asUMLEntityAttribute
UMLEntityAttribute * asUMLEntityAttribute()
Definition: umlobject.cpp:1425
UMLObject::name
QString name() const
Definition: umlobject.cpp:207
UMLEntityConstraint::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: entityconstraint.cpp:65
UMLForeignKeyConstraint::setUpdateAction
void setUpdateAction(UpdateDeleteAction uda)
Definition: foreignkeyconstraint.cpp:440
UMLObject::asUMLEntity
UMLEntity * asUMLEntity()
Definition: umlobject.cpp:1424
entity.h
UMLForeignKeyConstraint::m_ReferencedEntity
UMLEntity * m_ReferencedEntity
The UMLEntity that this foreign key references.
Definition: foreignkeyconstraint.h:105
UMLObject::ot_ForeignKeyConstraint
@ ot_ForeignKeyConstraint
Definition: umlobject.h:102
UMLForeignKeyConstraint::setReferencedEntity
void setReferencedEntity(UMLEntity *ent)
Definition: foreignkeyconstraint.cpp:335
foreignkeyconstraint.h
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:373
UMLForeignKeyConstraint
Sets up Foreign Key entity constraint information.
Definition: foreignkeyconstraint.h:27
logError0
#define logError0(s)
Definition: uml.h:537
UMLObject::asUMLForeignKeyConstraint
UMLForeignKeyConstraint * asUMLForeignKeyConstraint()
Definition: umlobject.cpp:1430
UniqueID::init
void init()
Definition: uniqueid.cpp:32
object_factory.h
Uml::SignatureType::SigNoVis
@ SigNoVis
Definition: basictypes.h:163
Uml::ID::toString
QString toString(const ID::Type &id)
Definition: basictypes.cpp:1306
UMLForeignKeyConstraint::uda_SetDefault
@ uda_SetDefault
Definition: foreignkeyconstraint.h:41
logError1
#define logError1(s, a)
Definition: uml.h:543
UMLForeignKeyConstraint::operator==
bool operator==(const UMLForeignKeyConstraint &rhs) const
Definition: foreignkeyconstraint.cpp:66
UMLObject::umlParent
UMLObject * umlParent() const
Definition: umlobject.cpp:676
UMLForeignKeyConstraint::m_pEntityAttributeIDMap
QMap< UMLEntityAttribute *, Uml::ID::Type > m_pEntityAttributeIDMap
Definition: foreignkeyconstraint.h:101
UMLEntityConstraint
Sets up entity constraint information.
Definition: entityconstraint.h:21
UMLObject::save1end
void save1end(QXmlStreamWriter &writer)
Definition: umlobject.cpp:937
Uml::ID::Type
std::string Type
Definition: basictypes.h:371
UMLForeignKeyConstraint::setDeleteAction
void setDeleteAction(UpdateDeleteAction uda)
Definition: foreignkeyconstraint.cpp:432
UMLForeignKeyConstraint::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: foreignkeyconstraint.cpp:88
UMLForeignKeyConstraint::m_pReferencedEntityID
Uml::ID::Type m_pReferencedEntityID
Used to resolve forward references to UMLEntity.
Definition: foreignkeyconstraint.h:94
UMLObject
The base class for UML objects.
Definition: umlobject.h:69
UMLForeignKeyConstraint::getReferencedEntity
UMLEntity * getReferencedEntity() const
Definition: foreignkeyconstraint.cpp:349
entityconstraint.h
UMLObject::m_BaseType
ObjectType m_BaseType
objects type
Definition: umlobject.h:308
UMLForeignKeyConstraint::clearMappings
void clearMappings()
Definition: foreignkeyconstraint.cpp:366
Uml::ID::fromString
ID::Type fromString(const QString &id)
Definition: basictypes.cpp:1311
entityattribute.h
number
it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted the original copyright holder who places the Library under this License may add an geographical distribution limitation excluding those so that distribution is permitted only in or among countries not thus excluded In such this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the Library General Public License from time to time Such new versions will be similar in spirit to the present but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Library specifies a version number of this License which applies to it and any later you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Library does not specify a license version number
Definition: LGPL-2.0-only.txt:368
UMLForeignKeyConstraint::resolveRef
bool resolveRef()
Definition: foreignkeyconstraint.cpp:375
UMLForeignKeyConstraintDialog
A dialog page to display foreignkey constraint properties.
Definition: umlforeignkeyconstraintdialog.h:37
UMLForeignKeyConstraint::m_UpdateAction
UpdateDeleteAction m_UpdateAction
What to do on Update of referenced attributes.
Definition: foreignkeyconstraint.h:112
UMLForeignKeyConstraint::getEntityAttributePairs
QMap< UMLEntityAttribute *, UMLEntityAttribute * > getEntityAttributePairs()
Definition: foreignkeyconstraint.cpp:408
basictypes.h
int
int int y int
Definition: cxx11-lambda-functions-and-expressions.h:4
Uml::SignatureType::Enum
Enum
Definition: basictypes.h:160
MyProject\connect
connect()
Definition: namespaces-multiple.php:5
logWarn1
#define logWarn1(s, a)
Definition: uml.h:542
UMLObject::doc
QString doc() const
Definition: umlobject.cpp:431
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:276
UMLDoc::name
QString name() const
Definition: umldoc.cpp:2020
UMLDoc
Definition: umldoc.h:69
UMLForeignKeyConstraint::slotReferencedEntityChanged
void slotReferencedEntityChanged()
Definition: foreignkeyconstraint.cpp:357
UMLForeignKeyConstraint::uda_SetNull
@ uda_SetNull
Definition: foreignkeyconstraint.h:40
Uml
Definition: basictypes.cpp:22
UMLForeignKeyConstraint::hasEntityAttributePair
bool hasEntityAttributePair(UMLEntityAttribute *pAttr, UMLEntityAttribute *rAttr) const
Definition: foreignkeyconstraint.cpp:254
UMLDoc::tagEq
static bool tagEq(const QString &tag, const QString &pattern)
Definition: umldoc.cpp:3603
UMLForeignKeyConstraint::saveToXMI
void saveToXMI(QXmlStreamWriter &writer)
Definition: foreignkeyconstraint.cpp:143
UMLForeignKeyConstraint::getDeleteAction
UpdateDeleteAction getDeleteAction() const
Definition: foreignkeyconstraint.cpp:416
logDebug4
#define logDebug4(s, a, b, c, d)
Definition: uml.h:557
uml.h
Uml::SignatureType::ShowSig
@ ShowSig
Definition: basictypes.h:162
MultiPageDialogBase::exec
int exec()
Definition: multipagedialogbase.cpp:218
UMLForeignKeyConstraint::m_AttributeMap
QMap< UMLEntityAttribute *, UMLEntityAttribute * > m_AttributeMap
Definition: foreignkeyconstraint.h:110
debug_utils.h
Uml::SignatureType::NoSig
@ NoSig
Definition: basictypes.h:161
UMLForeignKeyConstraint::toString
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig, bool withStereotype=false) const
Definition: foreignkeyconstraint.cpp:118
umlobject.h
UMLForeignKeyConstraint::~UMLForeignKeyConstraint
virtual ~UMLForeignKeyConstraint()
Definition: foreignkeyconstraint.cpp:80
UMLForeignKeyConstraint::init
void init()
Definition: foreignkeyconstraint.cpp:47
UMLForeignKeyConstraint::UMLForeignKeyConstraint
UMLForeignKeyConstraint(UMLObject *parent, const QString &name, Uml::ID::Type id=Uml::ID::None)
Definition: foreignkeyconstraint.cpp:27
UMLForeignKeyConstraint::uda_Cascade
@ uda_Cascade
Definition: foreignkeyconstraint.h:39
UMLForeignKeyConstraint::uda_NoAction
@ uda_NoAction
Definition: foreignkeyconstraint.h:37
UMLForeignKeyConstraint::addEntityAttributePair
bool addEntityAttributePair(UMLEntityAttribute *pAttr, UMLEntityAttribute *rAttr)
Definition: foreignkeyconstraint.cpp:181
UMLForeignKeyConstraint::clone
virtual UMLObject * clone() const
Definition: foreignkeyconstraint.cpp:105
UMLForeignKeyConstraint::sigReferencedEntityChanged
void sigReferencedEntityChanged()
Definition: moc_foreignkeyconstraint.cpp:139
UMLEntityAttribute
Sets up entityattribute information.
Definition: entityattribute.h:20
umlforeignkeyconstraintdialog.h
UMLClassifier::findChildObjectById
virtual UMLObject * findChildObjectById(Uml::ID::Type id, bool considerAncestors=false) const
Definition: classifier.cpp:545
UMLForeignKeyConstraint::removeEntityAttributePair
bool removeEntityAttributePair(UMLEntityAttribute *pAttr)
Definition: foreignkeyconstraint.cpp:241
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1063
umldoc.h
UMLForeignKeyConstraint::uda_Restrict
@ uda_Restrict
Definition: foreignkeyconstraint.h:38
UMLObject::save1
void save1(QXmlStreamWriter &writer, const QString &type, const QString &tag=QString())
Definition: umlobject.cpp:861
logError2
#define logError2(s, a, b)
Definition: uml.h:549
UMLForeignKeyConstraint::showPropertiesDialog
virtual bool showPropertiesDialog(QWidget *parent=0)
Definition: foreignkeyconstraint.cpp:169
logDebug0
#define logDebug0(s)
Definition: uml.h:533