Example #1
0
 function createEnumerationTable($enumeration, $dbSchema)
 {
     if ($this->is_table_filtered($enumeration['name'])) {
         $this->logger->log("<br>Ignoriere Enumeration: {$enumeration['name']}");
     }
     $this->logger->log('<br><b>Create Enumeration Tables: ' . $enumeration['name'] . '</b> (' . $enumeration['xmi_id'] . ')');
     $table = new Table($enumeration['name']);
     # read Values
     $enumType = new EnumType($enumeration['name'], $this->logger);
     $enumType->setSchemas($this->umlSchema, $dbSchema);
     $enumType->setId($enumeration['id']);
     $table->values = $enumType->getValues($enumeration);
     # definiere Attribute
     $wert_type = empty($enumType) ? 'chacacter varying' : $enumType->getWertType();
     $attribute = new Attribute('wert', $wert_type);
     $table->addAttribute($attribute);
     $attribute = new Attribute('beschreibung', 'character varying');
     $table->addAttribute($attribute);
     # definiere Primärschlüssel
     $table->primaryKey = 'wert';
     $this->logger->log($table->values->asTable($table->attributes));
     #		if (
     #			$table->values->rows[0][0] != $table->values->rows[0][1] AND
     #			$table->values->rows[0][1] != 'NULL'
     #		)
     # definiere Commentare
     $table->addComment('UML-Typ: Enumeration');
     $sql .= $table->asSql();
     $this->enumerations[$enumType->name] = $enumType;
     $this->logger->log('<pre>' . $tableSql . '</pre>');
     return $sql;
 }
Example #2
0
 function createCodeListTable($code_list)
 {
     $this->logger->log('<br><b>CodeList: ' . $code_list['name'] . '</b> (' . $code_list['xmi_id'] . ')');
     $table = new Table($code_list['name']);
     # definiere Attribute
     $attribute = new Attribute('codeSpace', 'text');
     $table->addAttribute($attribute);
     $attribute = new Attribute('id', 'character varying');
     $table->addAttribute($attribute);
     # definiere Primärschlüssel
     $table->primaryKey = 'id';
     # definiere Commentare
     $table->addComment('UML-Typ: Code Liste');
     $sql = $table->asSql();
     $this->logger->log('<pre>' . $sql . '</pre>');
     return $sql;
 }