code: public List<Geometry> getGeometriesIn( String tableName, Geometry intersectionGeometry, String... prePostWhere )
              throws Exception {
          List<Geometry> geoms = new ArrayList<Geometry>();
  
          List<String> wheres = new ArrayList<>();
          String pre = "";
          String post = "";
          String where = "";
          if (prePostWhere != null && prePostWhere.length == 3) {
              if (prePostWhere[0] != null)
                  pre = prePostWhere[0];
              if (prePostWhere[1] != null)
                  post = prePostWhere[1];
              if (prePostWhere[2] != null) {
                  where = prePostWhere[2];
                  wheres.add(where);
              }
          }
          GeometryColumn gCol = getGeometryColumnsForTable(tableName);
          String sql = "SELECT " + pre + gCol.geometryColumnName + post + " FROM " + tableName;
  
          if (intersectionGeometry != null) {
              intersectionGeometry.setSRID(gCol.srid);
              wheres.add(getSpatialindexGeometryWherePiece(tableName, null, intersectionGeometry));
          }
  
          if (wheres.size() > 0) {
              sql += " WHERE " + DbsUtilities.joinBySeparator(wheres, " AND ");
          }
  
          IGeometryParser geometryParser = getType().getGeometryParser();
          String _sql = sql;
          return execOnConnection(connection -> {
              try (IHMStatement stmt = connection.createStatement(); IHMResultSet rs = stmt.executeQuery(_sql)) {
                  while( rs.next() ) {
                      Geometry geometry = geometryParser.fromResultSet(rs, 1);
                      geoms.add(geometry);
                  }
                  return geoms;
              }
          });
  
      }
docs: Get the geometries of a table intersecting a given geometry.
  
  @param tableName
  the table name.
  @param intersectionGeometry
  the geometry to check, assumed in the same srid of the table geometry.
  @param prePostWhere an optional set of 3 parameters. The parameters are: a
  prefix wrapper for geom, a postfix for the same and a where string
  to apply. They all need to be existing if the parameter is passed.
  @return The list of geometries intersecting the geometry.
  @throws Exception