code: public DatabaseMapping map(Connection conn) throws SQLException {
          DatabaseMetaData dmd = conn.getMetaData();
          Map<TableRef, TableMapping> mappedTables = new HashMap<TableRef, TableMapping>();
          TableMetaDataReader metaDataReader = new TableMetaDataReader(new DefaultGeometryColumnTest(typeMapper()));
          MappedClassGenerator mappedClassGenerator = new MappedClassGenerator(packageName(), naming(), typeMapper());
  
          for (TableRef tableRef : configuredTables()) {
              if (isAlreadyMapped(tableRef, mappedTables)) continue;
              try {
                  TableMetaData tableMetaData = metaDataReader.read(getTableConfig(tableRef), dmd);
                  TableMapping tableMapping = mappedClassGenerator.generate(tableMetaData, classLoader);
                  mappedTables.put(tableRef, tableMapping);
              } catch (TableNotFoundException e) {
                  LOGGER.warn(e.getMessage());
              } catch (MissingIdentifierException e) {
                  LOGGER.warn(e.getMessage());
              }
          }
          return new DatabaseMapping(mappedTables, packageName());
      }
docs: Returns the <code>DatabaseMapping</code> that describes the mapping for all tables listed in the
  <code>AutoMapConfiguration</code> of this instance.
  <p/>
  <p>As a side-effect, the POJO classes corresponding to the tables are generated and loaded in the
  <code>ClassLoader</code> associated with this instance.</p>
  <p/>
  <p>To create the mapping, a <code>Connection</code> object must be
  provided to provide access to the specified tables. This connection will <em>not</em> be closed on return.</p>
  <p/>
  <p>If for some reason the mapping operation for a table fails (e.g. no identifier), then a warning will be written
  to the log, and the operation will continue with the next table.</p>
  
  @param conn JDBC <code>Connection</code> used during mapping
  @return the XML mapping document that maps the tables listed in the <code>AutoMapConfiguration</code> of this instance.
  @throws SQLException          if the JDBC <code>DataBaseMetaData</code> cannot be retrieved from the specified <code>Connection</code>
  @throws IllegalStateException if this method is run twice on the same instance.