docs: public final void loadSqlTables() throws Exception {
      for (Class<?> clazz : this.mngSettings.getClasses()) {
        TableSql tableSql = new TableSql();
        makeTableSqlFromXml(tableSql, clazz);
        this.tablesMap.put(clazz.getSimpleName(), tableSql);
      }
      for (Class<?> clazz : this.mngSettings.getClasses()) {
        TableSql tableSql = this.tablesMap.get(clazz.getSimpleName());
        StringBuffer sbIdNamesUc = new StringBuffer("");
        for (int i = 0; i < tableSql.getIdColumnsNames().length; i++) {
          if (i > 0) {
            sbIdNamesUc.append(",");
          }
          sbIdNamesUc.append(tableSql.getIdColumnsNames()[i].toUpperCase());
        }
        Field[] fields = getUtlReflection().retrieveFields(clazz);
        for (Field field : fields) {
          FieldSql fieldSql = tableSql.getFieldsMap().get(field.getName());
          if (fieldSql != null) { //if persistable or composite (foreign CID)
            String fldTypeSmpNm = field.getType().getSimpleName();
            try {
              TableSql tableSqlForeign = this.tablesMap.get(fldTypeSmpNm);
              if (tableSqlForeign != null) {
                //if it's foreign entity according entities list ORDER
                //make sure ORDER of entities!!!
                fieldSql.setForeignEntity(fldTypeSmpNm);
                String isNullableStr = this.mngSettings
                  .lazFldSts(clazz, field.getName()).get("isNullable");
                if (fieldSql.getDefinition() != null // FK composite ID
                  && !Boolean.valueOf(isNullableStr)
                    && !fieldSql.getDefinition().contains("not null")) {
                  fieldSql.setDefinition(fieldSql.getDefinition() + " not null");
                }
                //FK:
                StringBuffer sbForeignIdNamesUc = new StringBuffer("");
                for (int i = 0; i < tableSqlForeign.getIdColumnsNames()
                  .length; i++) {
                  if (i > 0) {
                    sbForeignIdNamesUc.append(",");
                  }
                  sbForeignIdNamesUc.append(tableSqlForeign
                    .getIdColumnsNames()[i].toUpperCase());
                }
                String fkNames;
                if (tableSqlForeign.getIdColumnsNames().length > 1) {
                  // composite FK:
                  fkNames = sbForeignIdNamesUc.toString();
                  // check if it is also primary key:
                  boolean isAlsoPk = true;
                  if (tableSql.getIdColumnsNames().length
                    == tableSqlForeign.getIdColumnsNames().length) {
                    for (int i = 0; i < tableSql.getIdColumnsNames()
                      .length; i++) {
                      if (!tableSqlForeign.getIdColumnsNames()[0]
                        .equals(tableSql.getIdColumnsNames()[0])) {
                        isAlsoPk = false;
                        break;
                      }
                    }
                  }
                  if (isAlsoPk) {
                    fieldSql.setTypeField(ETypeField.COMPOSITE_FK_PK);
                  } else {
                    fieldSql.setTypeField(ETypeField.COMPOSITE_FK);
                  }
                  for (String cIdNm : tableSqlForeign.getIdColumnsNames()) {
                    FieldSql fldCid = new FieldSql();
                    fldCid.setTypeField(ETypeField.DERIVED_FROM_COMPOSITE);
                    if (!Boolean.valueOf(isNullableStr)
                        && !tableSqlForeign.getFieldsMap()
                          .get(cIdNm).getDefinition().contains("not null")) {
                      fldCid.setDefinition(tableSqlForeign.getFieldsMap()
                        .get(cIdNm).getDefinition() + " not null");
                    } else if (Boolean.valueOf(isNullableStr)
                        && fldCid.getDefinition().contains("not null")) {
                      fldCid.setDefinition(tableSqlForeign.getFieldsMap()
                        .get(cIdNm).getDefinition().replace(" not null", ""));
                    } else {
                      fldCid.setDefinition(tableSqlForeign.getFieldsMap()
                        .get(cIdNm).getDefinition());
                    }
                    fldCid.setForeignEntity(tableSqlForeign.getFieldsMap()
                      .get(cIdNm).getForeignEntity());
                    tableSql.getFieldsMap().put(cIdNm, fldCid);
                  }
                } else {
                  fkNames = field.getName().toUpperCase();
                  if (fieldSql.getDefinition() == null) {
                    throw new ExceptionWithCode(ExceptionWithCode
                      .CONFIGURATION_MISTAKE,
                        "Where is no definition FID class/name: "
                          + clazz.getSimpleName() + "/" + field.getName());
                  }
                }
                int hc = fldTypeSmpNm.hashCode();
                String hashCfesn;
                if (hc < 0) {
                  hc = -hc;
                  hashCfesn = "M" + hc;
                } else {
                  hashCfesn = String.valueOf(hc);
                }
  
                String constraintFk = "constraint fk"
                  + clazz.getSimpleName()
                  + hashCfesn + field.getName()
                  + " foreign key (" + fkNames
                  + ") references " + fldTypeSmpNm.toUpperCase()
                  + " (" + sbForeignIdNamesUc + ")";
                String constraint = tableSql.getConstraint();
                if (constraint != null) {
                  constraint += ",\n" + constraintFk;
                } else {
                  constraint = constraintFk;
                }
                tableSql.setConstraint(constraint);
              }
              //if field is PK, make sure NOT NULL:
              if (sbIdNamesUc.toString().contains(field.getName().toUpperCase())
                  && !fieldSql.getDefinition().contains("not null")) {
                fieldSql.setDefinition(fieldSql.getDefinition()
                  + " not null");
              }
            } catch (Exception e) {
              this.logger.error(null, ASrvOrm.class, "Error on load SQL tables:"
                + " class/field/fieldSql/tableSql - " + clazz.getSimpleName()
                  + "/" + field.getName() + "/" + fieldSql + "/" + tableSql);
              throw e;
            }
          }
        }
        try {
          for (String colIdNm : tableSql.getIdColumnsNames()) {
            if (tableSql.getFieldsMap().get(colIdNm) == null) {
            throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
              "Where is no column ID class/name: " + clazz.getSimpleName()
                + "/" + colIdNm);
            }
          }
          //PK if complex (composite or foreign entity):
          if (tableSql.getIdColumnsNames().length > 1 || tableSql.getFieldsMap()
            .get(tableSql.getIdColumnsNames()[0]).getForeignEntity() != null) {
            String constraintPk = "constraint pk"
              + clazz.getSimpleName() + tableSql.getIdColumnsNames()[0]
                + " primary key (" + sbIdNamesUc + ")";
            if (tableSql.getConstraint() == null) {
              tableSql.setConstraint(constraintPk);
            } else {
              tableSql.setConstraint(constraintPk
                + ",\n" + tableSql.getConstraint());
            }
          }
          String constraintAdd = this.mngSettings.lazClsSts(clazz)
            .get("constraintAdd");
          if (constraintAdd != null) {
            if (tableSql.getConstraint() == null) {
              tableSql.setConstraint(constraintAdd);
            } else {
              tableSql.setConstraint(tableSql.getConstraint()
                + ",\n" + constraintAdd);
            }
          }
        } catch (Exception e) {
          this.logger.error(null, ASrvOrm.class, "Error on load SQL tables:"
            + " class/tableSql - " + clazz.getSimpleName() + "/" + tableSql);
          throw e;
        }
      }
    }