umbrello/umbrello
SQLWriter Class Reference
#include <sqlwriter.h>

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 35 of file sqlwriter.h.
Public Member Functions | |
| SQLWriter () | |
| virtual | ~SQLWriter () |
| virtual void | writeClass (UMLClassifier *c) |
| virtual Uml::Programming_Language | getLanguage () |
| virtual QStringList | defaultDatatypes () |
| virtual const QStringList | reservedKeywords () const |
Protected Member Functions | |
| virtual void | printEntityAttributes (QTextStream &sql, UMLEntityAttributeList entityAttributeList) |
| virtual void | printUniqueConstraints (QTextStream &sql, UMLClassifierListItemList constrList) |
| virtual void | printForeignKeyConstraints (QTextStream &sql, UMLClassifierListItemList constrList) |
| virtual void | printCheckConstraints (QTextStream &sql, UMLClassifierListItemList constrList) |
| virtual void | printIndex (QTextStream &sql, UMLEntity *ent, UMLEntityAttributeList entAttList) |
| virtual void | printAutoIncrements (QTextStream &sql, UMLEntityAttributeList entAttList) |
Protected Attributes | |
| UMLEntity * | m_pEntity |
Constructor & Destructor Documentation
| SQLWriter::SQLWriter | ( | ) |
Definition at line 41 of file sqlwriter.cpp.
| SQLWriter::~SQLWriter | ( | ) | [virtual] |
Definition at line 44 of file sqlwriter.cpp.
Member Function Documentation
| 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 46 of file sqlwriter.cpp.
| Uml::Programming_Language SQLWriter::getLanguage | ( | ) | [virtual] |
returns "SQL"
Implements CodeGenerator.
Reimplemented in MySQLWriter, and PostgreSQLWriter.
Definition at line 162 of file sqlwriter.cpp.
| QStringList SQLWriter::defaultDatatypes | ( | ) | [virtual] |
Reimplement method from CodeGenerator.
Reimplemented from CodeGenerator.
Reimplemented in MySQLWriter, and PostgreSQLWriter.
Definition at line 166 of file sqlwriter.cpp.
| const QStringList SQLWriter::reservedKeywords | ( | ) | const [virtual] |
get list of reserved keywords
Reimplemented from CodeGenerator.
Definition at line 195 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 342 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 404 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 444 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 550 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 513 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 546 of file sqlwriter.cpp.
Member Data Documentation
UMLEntity* SQLWriter::m_pEntity [protected] |
Definition at line 65 of file sqlwriter.h.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference