Creates the parameters to the spatial index creation statement.

@param statement
the statement.
@return the optional parameters for the <code>CREATE INDEX</code> statement.
354417
protected Collection<String> getParameters(final CreateSpatialIndexStatement statement) {
      final Collection<String> parameters = new ArrayList<String>();
      if (StringUtils.trimToNull(statement.getGeometryType()) != null) {
         final String gType = getGtype(statement.getGeometryType().trim());
         if (gType != null) {
            parameters.add("layer_gtype=" + gType);
         }
      }
      if (StringUtils.trimToNull(statement.getTablespace()) != null) {
         parameters.add("tablespace=" + statement.getTablespace().trim());
      }
      return parameters;
   }
361468
@Override
    public QueryResult<P> execute(StatementOptions options, Object... params) {
        return multi(options).add(params).execute();
    }
105233
public void createSpatialIndex( String tableName, String geomColumnName ) throws Exception {
        if (geomColumnName == null) {
            geomColumnName = "the_geom";
        }
        String realColumnName = getProperColumnNameCase(tableName, geomColumnName);
        String realTableName = getProperTableNameCase(tableName);
        String sql = "CREATE SPATIAL INDEX ON " + realTableName + "(" + realColumnName + ");";

        execOnConnection(connection -> {
            try (IHMStatement stmt = connection.createStatement()) {
                stmt.execute(sql.toString());
            }
            return null;
        });

    }
335127
@Override
    protected void create(List<TableInfo> tableInfos)
    {
        StatementResult result = null;
        String statement = null;

        for (TableInfo tableInfo : tableInfos)
        {
            try
            {
                result = tableAPI.executeSync("DROP TABLE IF EXISTS " + tableInfo.getTableName());
                if (!result.isSuccessful())
                {
                    throw new SchemaGenerationException("Unable to DROP TABLE " + tableInfo.getTableName());
                }
                statement = buildCreateDDLQuery(tableInfo);
                result = tableAPI.executeSync(statement);
                if (!result.isSuccessful())
                {
                    throw new SchemaGenerationException("Unable to CREATE TABLE " + tableInfo.getTableName());
                }
                createIndexOnTable(tableInfo);
            }
            catch (IllegalArgumentException e)
            {
                logger.error("Invalid Statement. Caused By: ", e);
                throw new SchemaGenerationException(e, "Invalid Statement. Caused By: ");
            }
            catch (FaultException e)
            {
                logger.error("Statement couldn't be executed. Caused By: ", e);
                throw new SchemaGenerationException(e, "Statement couldn't be executed. Caused By: ");
            }
        }
    }
713697
public Iterator<Host> newQueryPlan(String loggedKeyspace, Statement statement) {
        if (statement instanceof SelectedHostStatement) {
            List<Host> hosts = Lists.newArrayListWithExpectedSize(1);
            Host host = ((SelectedHostStatement) statement).getHostCordinator();
            hosts.add(host);
            // _log.debug("Host selected for the query plan: ", host.getAddress());
            return hosts.iterator();
        } else {
            // use the RoundRobinPolicy's query plan for any other statement types.
            return super.newQueryPlan(loggedKeyspace, statement);
            // throw new UnsupportedOperationException("This load balancing policy is only for running the statements of type 'SelectedHostStatement'.");
        }
    }
845222
public static Closeable closeableFrom(@WillNotClose @Nullable final Statement statement) {
        return closeableFrom(statement, Statement::close);
    }
1169440
public static String parseExplainCall(String statement)
    {
        Matcher matcher = ExplainCallPreamble.matcher(statement);
        if ( ! matcher.lookingAt()) {
            return null;
        }
        return statement.substring(matcher.end());
    }
551581
public static TileColumn createTileColumnColumn(int index) {
		return new TileColumn(index, TileTable.COLUMN_TILE_COLUMN,
				GeoPackageDataType.INTEGER, null, true, 0, false);
	}
735228
private void createIndex(String tableName, String indexName, String... fieldNames)
    {
        StringBuilder builder = new StringBuilder();
        builder.append("CREATE INDEX IF NOT EXISTS ");
        builder.append(indexName);
        builder.append(" ON ");
        builder.append(tableName);
        builder.append(Constants.OPEN_ROUND_BRACKET);
        for (String fieldName : fieldNames)
        {
            builder.append(fieldName);
            builder.append(Constants.COMMA);
        }
        builder.deleteCharAt(builder.length() - 1);
        builder.append(Constants.CLOSE_ROUND_BRACKET);
        StatementResult result = tableAPI.executeSync(builder.toString());
        if (!result.isSuccessful())
        {
            throw new SchemaGenerationException("Unable to CREATE Index with Index Name [" + indexName
                    + "] for table [" + tableName + "]");
        }
    }
693646
public void addSQLParameter(Object o) {
	if (parameters == null) {
	    parameters = new ArrayList();
	}
	parameters.add(o);
    }
36817
@Override
  public <T> Cursor<T> selectCursor(String statement) {
    return delegate.selectCursor(statement);
  }
1312138
private void createSequencesConstraintsStatements(List<Statement> statements, Iterable<Sequence> sequences) {
		Statement statement = createUniqueConstraintStatement( SEQUENCE_NAME_PROPERTY, NodeLabel.SEQUENCE.name() );
		statements.add( statement );
	}
912201
protected void configure(Statement statement) {
        // for thread safety, grab local copy
        Closure configureStatement = this.configureStatement;
        if (configureStatement != null) {
            configureStatement.call(statement);
        }
    }
806765
@NonNull
  public BatchStatementBuilder addStatement(@NonNull BatchableStatement<?> statement) {
    if (statementsCount >= 0xFFFF) {
      throw new IllegalStateException(
          "Batch statement cannot contain more than " + 0xFFFF + " statements.");
    }
    statementsCount += 1;
    statementsBuilder.add(statement);
    return this;
  }
1036316
public static UserCustomColumn createBaseIdColumn(int index) {
		return UserCustomColumn.createColumn(index, COLUMN_BASE_ID,
				GeoPackageDataType.INTEGER, true, null);
	}
696061
public static ParameterizedAnalyticsQuery parameterized(final String statement,
        final JsonArray positionalParams) {
        return new ParameterizedAnalyticsQuery(statement, positionalParams, null, null);
    }
584145
public List<?> selectList(String statement, Object parameter){
    statement = dbSqlSessionFactory.mapStatement(statement);
    List<Object> resultList = sqlSession.selectList(statement, parameter);
    for (Object object : resultList) {
      fireEntityLoaded(object);
    }
    return resultList;
  }