• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • kdesdk
  • Sitemap
  • Contact Us
 

umbrello/umbrello

SQLWriter Class Reference

Class SQLWriter is a code generator for UMLClassifier objects. More...

#include <sqlwriter.h>

Inheritance diagram for SQLWriter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 SQLWriter ()
virtual ~SQLWriter ()
virtual QStringList defaultDatatypes ()
virtual Uml::Programming_Language getLanguage ()
virtual const QStringList reservedKeywords () const
virtual void writeClass (UMLClassifier *c)

Protected Member Functions

virtual void printAutoIncrements (QTextStream &sql, UMLEntityAttributeList entAttList)
virtual void printCheckConstraints (QTextStream &sql, UMLClassifierListItemList constrList)
virtual void printEntityAttributes (QTextStream &sql, UMLEntityAttributeList entityAttributeList)
virtual void printForeignKeyConstraints (QTextStream &sql, UMLClassifierListItemList constrList)
virtual void printIndex (QTextStream &sql, UMLEntity *ent, UMLEntityAttributeList entAttList)
virtual void printUniqueConstraints (QTextStream &sql, UMLClassifierListItemList constrList)

Protected Attributes

UMLEntity * m_pEntity

Detailed Description

Class SQLWriter is a code generator for UMLClassifier objects.

Create an instance of this class, and feed it a UMLClassifier when calling writeClass and it will generate a sql source file for that concept.

Definition at line 29 of file sqlwriter.h.


Constructor & Destructor Documentation

SQLWriter::SQLWriter (  ) 

Definition at line 36 of file sqlwriter.cpp.

SQLWriter::~SQLWriter (  )  [virtual]

Definition at line 40 of file sqlwriter.cpp.


Member Function Documentation

QStringList SQLWriter::defaultDatatypes (  )  [virtual]

Reimplement method from CodeGenerator.

Reimplemented from CodeGenerator.

Reimplemented in MySQLWriter, and PostgreSQLWriter.

Definition at line 162 of file sqlwriter.cpp.

Uml::Programming_Language SQLWriter::getLanguage (  )  [virtual]

Returns "SQL".

Implements CodeGenerator.

Reimplemented in MySQLWriter, and PostgreSQLWriter.

Definition at line 157 of file sqlwriter.cpp.

void SQLWriter::printAutoIncrements ( QTextStream &  sql,
UMLEntityAttributeList  entAttList 
) [protected, virtual]

Handles AutoIncrements.

The derived classes provide the actual body.

Parameters:
sql The Stream we should print to
entAttList The List of Entity Attributes that we want to auto increment

Reimplemented in MySQLWriter, and PostgreSQLWriter.

Definition at line 535 of file sqlwriter.cpp.

void SQLWriter::printCheckConstraints ( QTextStream &  sql,
UMLClassifierListItemList  constrList 
) [protected, virtual]

Prints out Check Constraints as "ALTER TABLE" statements.

Parameters:
sql The stream we should print to
constrList The checkConstraints to be printed

Reimplemented in MySQLWriter.

Definition at line 541 of file sqlwriter.cpp.

void SQLWriter::printEntityAttributes ( QTextStream &  sql,
UMLEntityAttributeList  entityAttributeList 
) [protected, virtual]

Prints out attributes as columns in the table.

Parameters:
sql the stream we should print to
entityAttributeList the attributes to be printed

Definition at line 339 of file sqlwriter.cpp.

void SQLWriter::printForeignKeyConstraints ( QTextStream &  sql,
UMLClassifierListItemList  constrList 
) [protected, virtual]

Prints out foreign key constraints as "ALTER TABLE" statements.

Parameters:
sql the stream we should print to
constrList the foreignkey constraints to be printed

Reimplemented in MySQLWriter.

Definition at line 434 of file sqlwriter.cpp.

void SQLWriter::printIndex ( QTextStream &  sql,
UMLEntity *  ent,
UMLEntityAttributeList  entAttList 
) [protected, virtual]

Prints out Indexes as "CREATE INDEX " statements.

Parameters:
sql The Stream we should print to
ent The Entity's attributes on which we want to create an Index
entAttList The list of entityattributes to create an index upon

Definition at line 504 of file sqlwriter.cpp.

void SQLWriter::printUniqueConstraints ( QTextStream &  sql,
UMLClassifierListItemList  constrList 
) [protected, virtual]

Prints out unique constraints (including primary key ) as "ALTER TABLE" statements.

Parameters:
sql the stream we should print to
constrList the unique constraints to be printed

Definition at line 395 of file sqlwriter.cpp.

const QStringList SQLWriter::reservedKeywords (  )  const [virtual]

Get list of reserved keywords.

Reimplemented from CodeGenerator.

Definition at line 192 of file sqlwriter.cpp.

void SQLWriter::writeClass ( UMLClassifier *  c  )  [virtual]

Call this method to generate sql code for a UMLClassifier.

Parameters:
c the class to generate code for

Implements SimpleCodeGenerator.

Definition at line 44 of file sqlwriter.cpp.


Member Data Documentation

UMLEntity* SQLWriter::m_pEntity [protected]

Definition at line 60 of file sqlwriter.h.


The documentation for this class was generated from the following files:
  • sqlwriter.h
  • sqlwriter.cpp

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdesdk

Skip menu "kdesdk"
  • kapptemplate
  • kate
  •     kate
  • kbugbuster
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello
Generated for kdesdk by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal