code: protected String generateDeleteMetadataSql(final CreateSpatialIndexStatement statement,
           final Database database) {
        final StringBuilder sql = new StringBuilder();
        sql.append("DELETE FROM user_sdo_geom_metadata ");
        final String tableName = statement.getTableName().trim();
        sql.append("WHERE table_name = '").append(database.correctObjectName(tableName, Table.class));
        final String columnName = statement.getColumns()[0].trim();
        sql.append("' AND column_name = '").append(
              database.correctObjectName(columnName, Column.class));
        sql.append("'");
        return sql.toString();
     }
docs: Generates the SQL for deleting any existing record from the
  <code>USER_SDO_GEOM_METADATA</code> table. Typically this record shouldn't be present but we
  must ensure that it does not already exist.
  
  @param statement
  the create spatial index statement.
  @param database
  the database instance.
  @return the SQL to delete any existing metadata record.