code: protected String createSQLStatement()
          throws EFapsException
      {
          final SQLSelect select = new SQLSelect()
              .column(0, "ID")
              .from(getBaseType().getMainTable().getSqlTable(), 0);
  
          // if the main table has a column for the type it is selected also
          if (getBaseType().getMainTable().getSqlColType() != null) {
              select.column(0, getBaseType().getMainTable().getSqlColType());
          }
          // add child tables
          if (getSqlTable2Index().size() > 0) {
              for (final Entry<SQLTable, Integer> entry : getSqlTable2Index().entrySet()) {
                  if (entry.getValue() > 0) {
                      select.leftJoin(entry.getKey().getSqlTable(), entry.getValue(), "ID", 0, "ID");
                  }
              }
          }
          select.addSection(getWhere());
          select.addSection(getOrderBy());
          select.addSection(getLimit());
  
          return select.getSQL();
      }
docs: Create the SQL statement.
  @return StringBuilder containing the statement
  @throws EFapsException on error