Creates String of Create Table Insert Quert

@param finalFieldName final field name
@return sql create table (name - type)
964014
private String buildInsertNameTypeQuery(final String finalFieldName,
                                            final IClassContainer container) {
        final Class<?> exportFieldType = container.getField(finalFieldName).getType();
        switch (container.getContainer(finalFieldName).getType()) {
            case ARRAY:
            case COLLECTION:
                final Class<?> type = exportFieldType.getComponentType();
                return finalFieldName + "\t" + translateJavaTypeToSqlType(type) + "[]";
            case ARRAY_2D:
                final Class<?> type2D = exportFieldType.getComponentType().getComponentType();
                return finalFieldName + "\t" + translateJavaTypeToSqlType(type2D) + "[][]";
            default:
                return finalFieldName + "\t" + translateJavaTypeToSqlType(exportFieldType);
        }
    }
159818
public static FieldType createFieldType(DatabaseType databaseType, String tableName, Field field,
			Class<?> parentClass) throws SQLException {
		DatabaseFieldConfig fieldConfig = DatabaseFieldConfig.fromField(databaseType, tableName, field);
		if (fieldConfig == null) {
			return null;
		} else {
			return new FieldType(databaseType, tableName, field, fieldConfig, parentClass);
		}
	}
672875
private String createInsertQuery() {
        StringBuilder query = new StringBuilder();
        query.append("insert into ").append(m_tableName)
                .append("(").append(m_propertyNames[0]);
        for (int i = 1; i < m_propertyNames.length; i++) {
            query.append(",").append(m_propertyNames[i]);
        }
        query.append(") values (?");
        for (int i = 1; i < m_propertyNames.length; i++) {
            query.append(",?");
        }
        query.append(")");
        return query.toString();
    }
760
@Override
    public Query createQuery(String qlString)
    {
        try
        {
            return ivEm.createQuery(qlString);
        } finally
        {
            if (!inJTATransaction())
            {
                ivEm.clear();
            }
        }
    }
611799
public static void createPropertiesTable( ASpatialDb database ) throws Exception {
        StringBuilder sb = new StringBuilder();
        sb.append("CREATE TABLE ");
        sb.append(PROPERTIESTABLE);
        sb.append(" (");
        sb.append(ID);
        sb.append(" INTEGER PRIMARY KEY AUTOINCREMENT, ");
        sb.append(NAME).append(" TEXT, ");
        sb.append(SIZE).append(" REAL, ");
        sb.append(FILLCOLOR).append(" TEXT, ");
        sb.append(STROKECOLOR).append(" TEXT, ");
        sb.append(FILLALPHA).append(" REAL, ");
        sb.append(STROKEALPHA).append(" REAL, ");
        sb.append(SHAPE).append(" TEXT, ");
        sb.append(WIDTH).append(" REAL, ");
        sb.append(LABELSIZE).append(" REAL, ");
        sb.append(LABELFIELD).append(" TEXT, ");
        sb.append(LABELVISIBLE).append(" INTEGER, ");
        sb.append(ENABLED).append(" INTEGER, ");
        sb.append(ORDER).append(" INTEGER,");
        sb.append(DASH).append(" TEXT,");
        sb.append(MINZOOM).append(" INTEGER,");
        sb.append(MAXZOOM).append(" INTEGER,");
        sb.append(DECIMATION).append(" REAL,");
        sb.append(THEME).append(" TEXT");
        sb.append(" );");
        String query = sb.toString();
        database.executeInsertUpdateDeleteSql(query);
    }
12995
protected void createTable(){
        sqlManager.executeUpdate(
                new StringSqlResource(String.format("CREATE TABLE %s (VERSION NUMERIC NOT NULL)", tableName)));

        sqlManager.executeUpdate(
                new StringSqlResource(String.format("INSERT INTO %s (0))", tableName)));
    }
493422
private String buildCreateTableQuery(final IClassContainer container,
                                         final String primaryKeyField) {
        final StringBuilder builder = new StringBuilder("CREATE TABLE IF NOT EXISTS ")
                .append(container.getExportClassName().toLowerCase())
                .append("(\n");

        final String resultValues = container.getFormatSupported(Format.SQL).entrySet().stream()
                .map(e -> "\t" + buildInsertNameTypeQuery(e.getValue().getExportName(), container))
                .collect(Collectors.joining(",\n"));

        builder.append(resultValues);

        // Write primary key constraint
        return builder.append(",\n")
                .append("\tPRIMARY KEY (")
                .append(primaryKeyField)
                .append(")\n);\n")
                .toString();
    }
794798
@Override
   public Sql[] generateSql(final InsertStatement statement, final Database database,
         final SqlGeneratorChain sqlGeneratorChain) {
      for (final Entry<String, Object> entry : statement.getColumnValues().entrySet()) {
         entry.setValue(handleColumnValue(entry.getValue(), database));
      }
      return super.generateSql(statement, database, sqlGeneratorChain);
   }
586664
private String getCreateTableSQL(String columns, String references, String uniqueColumns) {
		StringBuilder builder = new StringBuilder();
		builder.append("CREATE TABLE ").append(getTableName()).append("(");
		builder.append(columns);
		builder.append(references);
		builder.append("UNIQUE (").append(uniqueColumns).append(") ON CONFLICT REPLACE");
		builder.append(");");
		return builder.toString();
	}
1080231
private Query getNamedOrCreateQuery(String queryString) {
    if (queryString.charAt(0) == '@') return getSession().getNamedQuery(queryString.substring(1));
    else return getSession().createQuery(queryString);
  }
1271834
protected String constructQuery(String table, String[] fieldNames) {
    if(fieldNames == null) {
      throw new IllegalArgumentException("Field names may not be null");
    }

    StringBuilder query = new StringBuilder();
    query.append("INSERT INTO ").append(table);

    if (fieldNames.length > 0 && fieldNames[0] != null) {
      query.append(" (");
      for (int i = 0; i < fieldNames.length; i++) {
        query.append(fieldNames[i]);
        if (i != fieldNames.length - 1) {
          query.append(",");
        }
      }
      query.append(")");
    }
    query.append(" VALUES (");

    for (int i = 0; i < fieldNames.length; i++) {
      query.append("?");
      if(i != fieldNames.length - 1) {
        query.append(",");
      }
    }
    query.append(");");

    return query.toString();
  }
517794
protected ViewQuery createQuery(String viewName) {
		return new ViewQuery()
				.dbPath(db.path())
				.designDocId(stdDesignDocumentId)
				.viewName(viewName);
	}
163711
public Term createTerm(final String name, final String slug) throws SQLException {

      Connection conn = null;
      PreparedStatement stmt = null;
      ResultSet rs = null;
      Timer.Context ctx = metrics.createTermTimer.time();
      try {
         conn = connectionSupplier.getConnection();
         stmt = conn.prepareStatement(insertTermSQL, Statement.RETURN_GENERATED_KEYS);
         stmt.setString(1, name);
         stmt.setString(2, slug);
         stmt.executeUpdate();
         rs = stmt.getGeneratedKeys();
         if(rs.next()) {
            return new Term(rs.getLong(1), name, slug);
         } else {
            throw new SQLException("Problem creating term (no generated id)");
         }
      } finally {
         ctx.stop();
         closeQuietly(conn, stmt, rs);
      }
   }
416847
@Override
    public Query createNamedQuery(String name)
    {
        try
        {
            return ivEm.createNamedQuery(name);
        } finally
        {
            if (!inJTATransaction())
            {
                ivEm.clear();
            }
        }
    }
1331488
public String generateSqlSelect(String tableName) {
        try {
            return cacheSQLs.get("SELECT:" + tableName, () -> {
                return MessageFormat.format("SELECT {2} FROM {0} WHERE {1}", tableName,
                        strWherePkClause, strAllColumns);
            });
        } catch (ExecutionException e) {
            throw new DaoException(e);
        }
    }
1042527
private TableDDL createTableDDL(String tableName) {
        TableMetadata tableMetadata = _keyspace.getKeyspaceMetadata().getTable(tableName);
        String rowKeyColumnName = tableMetadata.getPrimaryKey().get(0).getName();
        String timeSeriesColumnName = tableMetadata.getPrimaryKey().get(1).getName();
        String valueColumnName = tableMetadata.getColumns().get(2).getName();

        return new TableDDL(tableMetadata, rowKeyColumnName, timeSeriesColumnName, valueColumnName);
    }
1293775
public String getSQL() {

        StringBuffer sb = new StringBuffer(256);

        sb.append(Tokens.T_CREATE).append(' ');
        sb.append(Tokens.T_TRIGGER).append(' ');
        sb.append(name.getSchemaQualifiedStatementName()).append(' ');
        sb.append(actionTimingString).append(' ');
        sb.append(eventTimingString).append(' ');
        sb.append(Tokens.T_ON).append(' ');
        sb.append(table.getName().getSchemaQualifiedStatementName());
        sb.append(' ');

        if (forEachRow) {
            sb.append(Tokens.T_FOR).append(' ');
            sb.append(Tokens.T_EACH).append(' ');
            sb.append(Tokens.T_ROW).append(' ');
        }

        if (nowait) {
            sb.append(Tokens.T_NOWAIT).append(' ');
        }

        if (maxRowsQueued != defaultQueueSize) {
            sb.append(Tokens.T_QUEUE).append(' ');
            sb.append(maxRowsQueued).append(' ');
        }

        sb.append(Tokens.T_CALL).append(' ');
        sb.append(StringConverter.toQuotedString(triggerClassName, '"',
                false));

        return sb.toString();
    }