docs: protected final void evalForeignSelect(final Map<String, Object> pAddParam,
      final String pFieldName, final FieldSql pFieldSql,
        final StringBuffer pQuery, final StringBuffer pJoints,
          final String pOwningEntityName, final String pOwningTableName,
            final boolean pIsFirstField) throws Exception {
      boolean isDbgSh = this.logger.getDbgSh(this.getClass())
        && this.logger.getDbgFl() < 7021 && this.logger.getDbgCl() > 7023;
      String currentLevelNm = "currentLevel";
      @SuppressWarnings("unchecked")
      List<Integer> currentLevel = (List<Integer>) pAddParam.get(currentLevelNm);
      currentLevel.set(0, currentLevel.get(0) + 1);
      String deepLevelNm = "deepLevel";
      @SuppressWarnings("unchecked")
      List<Integer> deepLevel = (List<Integer>) pAddParam.get(deepLevelNm);
      Integer deepLevelReq = (Integer) pAddParam.get(pOwningEntityName
        + pFieldName + deepLevelNm);
      if (deepLevelReq != null) { //required level sub-entity
        currentLevel.add(1);
        deepLevel.add(deepLevelReq);
      } //nothing for sub-entities
      if (isDbgSh) {
        StringBuffer sb = new StringBuffer();
        sb.append("Foreign pFieldName/pOwningEntityName/pOwningTableName/DLC: "
          + pFieldName + "/" + pOwningEntityName + "/" + pOwningTableName
            + "/" + deepLevelReq);
        sb.append("\ndeepLevel size/value1/value...: " + deepLevel
          .size() + "/");
        for (Integer dl : deepLevel) {
          sb.append(dl + "/");
        }
        sb.append("\ncurrentLevel size/value1/value...: "
          + currentLevel.size() + "/");
        for (Integer cl : currentLevel) {
          sb.append(cl + "/");
        }
        this.logger.debug(null, ASrvOrm.class, sb.toString());
      }
      if (deepLevel.size() != currentLevel.size()) {
        throw new Exception(
          "Algorithm error: deepLevel.size/currentLevel.size/Entity/Field"
            + deepLevel.size() + "/" + currentLevel.size() + "/"
              + pOwningEntityName + "/" + pFieldName);
      }
      if (deepLevel.get(deepLevel.size() - 1) == 1
        || currentLevel.get(currentLevel.size() - 1)
          > deepLevel.get(deepLevel.size() - 1)) {
        //no joints need, only ID
        String columnName = pFieldName.toUpperCase();
        if (!pIsFirstField) {
          pQuery.append(", ");
        }
        if (currentLevel.get(0) == 2) {
          // 1-st TOP level alias only field name:
          pQuery.append(pOwningTableName + "."
              + columnName + " as " + columnName);
        } else { // > 1-st, alias = foreign table alias + field Name
            pQuery.append(pOwningTableName + "."
              + columnName + " as " + pOwningTableName + columnName);
        }
      } else { //retrieve foreign entity required fields:
        boolean isFirstField = pIsFirstField;
        TableSql tableSql = getTablesMap().get(pFieldSql.getForeignEntity());
        if (tableSql == null) {
          throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
            "where_is_no_table_def_for::" + pFieldSql.getForeignEntity());
        }
        String tableForeign = pFieldSql.getForeignEntity().toUpperCase();
        String tbFrAlias;
        if (tableSql.getIdColumnsNames().length > 1) {
          StringBuffer sb = new StringBuffer();
          for (String idClNm : tableSql.getIdColumnsNames()) {
            sb.append(idClNm);
          }
          tbFrAlias = sb.toString().toUpperCase();
        } else {
          tbFrAlias = pFieldName.toUpperCase();
        }
        pJoints.append(" left join " + tableForeign + " as "
          + tbFrAlias + " on ");
        for (int i = 0; i < tableSql.getIdColumnsNames().length; i++) {
          if (i > 0) {
            pJoints.append(" and ");
          }
          String fieldFrNm;
          if (tableSql.getIdColumnsNames().length > 1) {
            //composite name as foreign:
            fieldFrNm = tableSql.getIdColumnsNames()[i].toUpperCase();
          } else {
            fieldFrNm = pFieldName.toUpperCase();
          }
          pJoints.append(pOwningTableName + "." + fieldFrNm + "=" + tbFrAlias
            + "." + tableSql.getIdColumnsNames()[i].toUpperCase());
        }
        @SuppressWarnings("unchecked")
        Collection<String> fieldsNames = (Collection<String>) pAddParam.
          get(pFieldSql.getForeignEntity() + "neededFields");
        if (fieldsNames == null) {
          fieldsNames = tableSql.getFieldsMap().keySet();
        }
        for (String fieldName : fieldsNames) {
          FieldSql fieldSql = tableSql.getFieldsMap().get(fieldName);
          if (!fieldSql.getTypeField()
            .equals(ETypeField.DERIVED_FROM_COMPOSITE)) {
            if (fieldSql.getForeignEntity() == null) {
              if (isFirstField) {
                isFirstField = false;
              } else {
                pQuery.append(", ");
              }
              pQuery.append(tbFrAlias + "." + fieldName.toUpperCase()
                + " as " + tbFrAlias + fieldName.toUpperCase());
            } else {
              // enter to recursion:
              if (currentLevel.size() > 1) {
                currentLevel.set(currentLevel.size() - 1,
                  currentLevel.get(currentLevel.size() - 1) + 1);
              }
              evalForeignSelect(pAddParam, fieldName, fieldSql, pQuery,
                pJoints, pFieldSql.getForeignEntity(), tbFrAlias, isFirstField);
              // exit form recursion:
              isFirstField = false;
              if (currentLevel.size() > 1) {
                //exit from overridden sub-entity deep:
                currentLevel.set(currentLevel.size() - 1,
                  currentLevel.get(currentLevel.size() - 1) - 1);
              }
            }
          }
        }
      }
      if (currentLevel.size() > 1
          && currentLevel.get(currentLevel.size() - 1) == 1) {
        currentLevel.remove(currentLevel.size() - 1);
        deepLevel.remove(deepLevel.size() - 1);
      }
      currentLevel.set(0, currentLevel.get(0) - 1);
    }