private function createDataDbMap()
    {
        if ($this->getDataDbMap() === null) {
            return;
        }

        // Produce the sql -> database map
        $datadbmap = new Properties();

        // Check to see if the sqldbmap has already been created.
        if ($this->getDataDbMap()->exists()) {
            $datadbmap->load($this->getDataDbMap());
        }

        foreach ($this->getDataModels() as $dataModel) { // there is really one 1 db per datamodel
            foreach ($dataModel->getDatabases() as $database) {

                // if database name is specified, then we only want to dump that one db.
                if (empty($this->databaseName) || ($this->databaseName && $database->getName() == $this->databaseName)) {
                    $outFile = $this->getMappedFile($dataModel->getName());
                    $datadbmap->setProperty($outFile->getName(), $database->getName());
                }
            }
        }

        try {
            $datadbmap->store($this->getDataDbMap(), "Data XML file -> Database map");
        } catch (IOException $e) {
            throw new IOException("Unable to store properties: " . $e->getMessage());
        }
    }