docs: public static void initRepositoryJSON(final String tablePrefix, final Set<String> tableNames, final String destPath) {
          Connection connection;
          FileWriter writer = null;
  
          try {
              final File file = new File(destPath);
              if (file.isDirectory()) {
                  LOGGER.log(Level.ERROR, "Can't generate repository definition file caused by the specified destination path [" + destPath + "] is a dir");
  
                  return;
              }
  
              connection = Connections.getConnection();
  
              final DatabaseMetaData databaseMetaData = connection.getMetaData();
              final ResultSet resultSet = databaseMetaData.getTables(null, "%", "%", new String[]{"TABLE"});
  
              final JSONObject repositoryJSON = new JSONObject();
              final JSONArray repositories = new JSONArray();
  
              repositoryJSON.put("repositories", repositories);
  
              while (resultSet.next()) {
                  final String fullTableName = resultSet.getString("TABLE_NAME");
                  final String tableName = StringUtils.substringAfter(fullTableName, tablePrefix);
                  if (!tableNames.contains(tableName)) {
                      continue;
                  }
  
                  final JSONObject repository = new JSONObject();
                  repositories.put(repository);
                  repository.put("name", tableName);
                  String remarks = resultSet.getString("REMARKS");
                  if (StringUtils.isNotBlank(remarks)) {
                      repository.put("description", remarks);
                  }
                  final JSONArray keys = new JSONArray();
                  repository.put("keys", keys);
  
                  final ResultSet rs = databaseMetaData.getColumns(null, "%", fullTableName, "%");
                  while (rs.next()) {
                      final String columnName = rs.getString("COLUMN_NAME");
                      remarks = rs.getString("REMARKS");
                      final int dataType = rs.getInt("DATA_TYPE");
                      final int length = rs.getInt("COLUMN_SIZE");
                      final int nullable = rs.getInt("NULLABLE");
  
                      final JSONObject key = new JSONObject();
                      keys.put(key);
                      key.put("name", columnName);
                      if (StringUtils.isNotBlank(remarks)) {
                          key.put("description", remarks);
                      }
                      if (0 != nullable) {
                          key.put("nullable", true);
                      }
  
                      switch (dataType) {
                          case Types.CHAR:
                          case Types.LONGNVARCHAR:
                          case Types.LONGVARCHAR:
                          case Types.NCHAR:
                          case Types.NVARCHAR:
                          case Types.VARCHAR:
                              key.put("type", "String");
  
                              break;
                          case Types.BIGINT:
                              key.put("type", "long");
  
                              break;
                          case Types.INTEGER:
                          case Types.SMALLINT:
                          case Types.TINYINT:
                              key.put("type", "int");
  
                              break;
                          case Types.DATE:
                              key.put("type", "Date");
  
                              break;
                          case Types.TIME:
                          case Types.TIMESTAMP:
                              key.put("type", "Datetime");
  
                              break;
                          case Types.DECIMAL:
                          case Types.NUMERIC:
                              key.put("type", "Decimal");
                              key.put("precision", rs.getInt("DECIMAL_DIGITS"));
  
                              break;
                          case Types.BIT:
                              key.put("type", "Bit");
  
                              break;
                          case Types.CLOB:
                              key.put("type", "Clob");
  
                              break;
                          case Types.BLOB:
                              key.put("type", "Blob");
  
                              break;
                          case Types.DOUBLE:
                              key.put("type", "double");
  
                              break;
                          default:
                              throw new IllegalStateException("Unsupported type [" + dataType + ']');
                      }
  
                      key.put("length", length);
                  }
              }
  
              FileUtils.deleteQuietly(file);
              writer = new FileWriter(file);
              final String content = repositoryJSON.toString(Integer.valueOf("2"));
              IOUtils.write(content, writer);
  
              LOGGER.log(Level.INFO, "Generated repository definition file [" + destPath + "]");
          } catch (final Exception e) {
              LOGGER.log(Level.ERROR, "Init repository.json failed", e);
          } finally {
              IOUtils.closeQuietly(writer);
          }
      }