code: public static String convertToFunction(final String wkt, final String srid,
           final Database database, final WktInsertOrUpdateGenerator generator) {
        if (wkt == null || wkt.equals("")) {
           throw new IllegalArgumentException(
                 "The Well-Known Text cannot be null or empty");
        }
        if (generator == null) {
           throw new IllegalArgumentException("The generator cannot be null or empty");
        }
        final String geomFromTextFunction = generator.getGeomFromWktFunction();
        String function = geomFromTextFunction + "('" + wkt + "'";
        if (srid != null && !srid.equals("")) {
           function += ", " + srid;
        } else if (generator.isSridRequiredInFunction(database)) {
           throw new IllegalArgumentException("An SRID was not provided with '" + wkt
                 + "' but is required in call to '" + geomFromTextFunction + "'");
        }
        function += ")";
        return function;
     }
docs: Converts the given Well-Known Text and SRID to the appropriate function
  call for the database.
  
  @param wkt
  the Well-Known Text string.
  @param srid
  the SRID string which may be an empty string.
  @param database
  the database instance.
  @param generator
  the SQL generator.
  @return the string that converts the WKT to a database-specific geometry.