diff --git a/sources/lib/Generator/StructureGenerator.php b/sources/lib/Generator/StructureGenerator.php
index <HASH>..<HASH> 100644
--- a/sources/lib/Generator/StructureGenerator.php
+++ b/sources/lib/Generator/StructureGenerator.php
@@ -47,7 +47,6 @@ Class and fields comments are inspected from table and fields comments. Just add
 @see http://www.postgresql.org/docs/9.0/static/sql-comment.html
 TEXT;
         }
-
         $this
             ->outputFileCreation($output)
             ->saveFile(
@@ -56,7 +55,11 @@ TEXT;
                     [
                         'namespace'      => $this->namespace,
                         'class_name'     => $input->getParameter('class_name', Inflector::studlyCaps($this->relation)),
-                        'relation'       => sprintf("%s.%s", $this->schema, $this->relation),
+                        'relation'       => sprintf(
+                            "%s.%s",
+                            $this->getSession()->getConnection()->escapeIdentifier($this->schema),
+                            $this->getSession()->getConnection()->escapeIdentifier($this->relation)
+                        ),
                         'primary_key'    => join(
                             ', ',
                             array_map(
Escape generated structure’s relation name

The relations detected by the inspector are database objects. Their name
must be escaped to prevent problems when when a legacy database with
uppercase letters are used in their relations.