Create String of Create Table Query
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();
    }
1163533
public function createSQL()
	{
		try {

			$lines = array();

			$indices = array();

			$columns = $this->columns;

			$template = "CREATE TABLE %s (\n%s,\n%s\n) ENGINE=%s DEFAULT CHARSET=%s;";

			foreach ($this->columns as $column_name => $column)
			{

				//$column_name = $column["name"];//set the column name

				$data_type = $column["type"];//set the column data type

				$length = $column["length"];//set the lenght of the data type

				if ($column["primary"])	$indices[] = "PRIMARY KEY ({$column_name})"; //add primary key field

				if ($column["index"]) $indices[] = "KEY {$column_name} ({$column_name})"; //add index field

				switch ($data_type)
				{
					case "autonumber":

						$lines[] = "{$column_name} INT(11) NOT NULL AUTO_INCREMENT";

						break;

					case "text":

						if ($length !== null && $length <= 255)	$lines[] = "{$column_name} VARCHAR({$length}) DEFAULT NULL";

						else $lines[] = "{$column_name} text";

						break;

					case "integer":

						$lines[] = "{$column_name} INT(11) DEFAULT NULL";

						break;

					case "decimal":

						$lines[] = "{$column_name} FLOAT DEFAULT NULL";

						break;

					case "boolean":

						$lines[] = "{$column_name} TINYINT(4) DEFAULT NULL";

						break;

					case "datetime":

						$lines[] = "{$column_name} DATETIME DEFAULT NULL";

						break;

				}

			}

			$this->query_string = sprintf($template, $this->table, join(",\n", $lines), join(",\n", $indices), 'InnoDB', 'utf8');//$this->connection->character_set_name()
			
			return $this;

		} catch (MySQLException $e) {

			$e->errorShow();

		}
		
	}
1063690
void createTable() {
        Connection con = null;
        java.sql.Statement s = null;

        //PK55900 We can pass in true to the getConnection method since this method,
        //createTable, is only called from the initDBSettings method.
        con = getConnection(true);
        if (con == null) {
            return;
        }

        try {

            try {
                s = con.createStatement();
                if (!getTableDefinition(con)) {
                    if (usingOracle) {
                        if (_smc.isUseOracleBlob()) { // cmd LI1963 start
                            s.executeUpdate("create table "
                                            + tableName
                                            + " (id varchar(128) not null, propid varchar(128) not null, appname varchar(128) not null, listenercnt smallint, lastaccess integer, creationtime integer, maxinactivetime integer, username varchar(256), small raw("
                                            + SMALLCOL_SIZE_ORACLE + "), medium BLOB, large raw(1))");
                        } else {
                            s.executeUpdate("create table "
                                            + tableName
                                            + " (id varchar(128) not null, propid varchar(128) not null, appname varchar(128) not null, listenercnt smallint, lastaccess integer, creationtime integer, maxinactivetime integer, username varchar(256), small raw("
                                            + SMALLCOL_SIZE_ORACLE + "), medium long raw, large raw(1))");
                        } // cmd LI1963 end
                    } else if (usingAS400DB2) {
                        try { //if using AS400, create collection first
                            s.executeUpdate("CREATE COLLECTION " + collectionName);
                        } catch (Exception e) {
                            com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.session.store.db.DatabaseHashMap.createTable", "470", con);
                        }
                        s.executeUpdate("create table "
                                        + tableName
                                        + " (id varchar(128) not null, propid varchar(128) not null, appname varchar(128) not null, listenercnt smallint, lastaccess bigint, creationtime bigint, maxinactivetime integer, username varchar(256), small varchar("
                                        + SMALLCOL_SIZE_DB2 + ") for bit data, medium long varchar for bit data, large BLOB(2M))");
                    } else if (usingSybase) {
                        s.executeUpdate("create table "
                                        + tableName
                                        + " (id varchar(128) not null, propid varchar(128) not null, appname varchar(128) not null, listenercnt smallint null, lastaccess numeric(21,0) null, creationtime numeric(21,0) null, maxinactivetime numeric(10,0) null, username varchar(255) null, small image null, medium image null, large image null)");
                    } else if (usingSQLServer) {
                        s.executeUpdate("create table "
                                        + tableName
                                        + " (id varchar(128) not null, propid varchar(128) not null, appname varchar(128) not null, listenercnt smallint null, lastaccess decimal(21,0) null, creationtime decimal(21,0) null, maxinactivetime integer null, username varchar(255) null, small image null, medium image null, large image null)");
                    } else if (usingInformix) {
                        s.executeUpdate("create table "
                                        + tableName
                                        + " (id varchar(128) not null, propid varchar(128) not null, appname varchar(128) not null, listenercnt smallint, lastaccess int8, creationtime int8, maxinactivetime integer, username varchar(255), small BYTE, medium BYTE, large BYTE)");
                    } else if (usingCloudScape) {
                        s.executeUpdate("create table "
                                        + tableName
                                        + " (id varchar(128) not null, propid varchar(128) not null, appname varchar(128) not null, listenercnt smallint, lastaccess bigint, creationtime bigint, maxinactivetime integer, username varchar(255), small LONG VARBINARY , medium char(1) , large char(1))");
                    } else if (dbHandler != null) {
                        dbHandler.createTable(s, tableName);
                    } else if (!usingDB2Connect && !usingDB2zOS) { // LIDB2775.25 zOS
                        String tableSpaceName = " ";
                        // a little overkill for this test
                        String configTableSpaceName = _smc.getTableSpaceName();
                        if (configTableSpaceName != null && !configTableSpaceName.equals("") && configTableSpaceName.length() != 0)
                            tableSpaceName = " in " + configTableSpaceName;
                        if (usingSolidDB)
                            s.executeUpdate("create table "
                                        + tableName
                                        + " (id varchar(128) not null, propid varchar(128) not null, appname varchar(128) not null, listenercnt smallint, lastaccess bigint, creationtime bigint, maxinactivetime integer, username varchar(256), small varchar("
                                        + smallColSize + "), medium long varchar, large BLOB(2M)) " + tableSpaceName);
                        else
                            s.executeUpdate("create table "
                                        + tableName
                                        + " (id varchar(128) not null, propid varchar(128) not null, appname varchar(128) not null, listenercnt smallint, lastaccess bigint, creationtime bigint, maxinactivetime integer, username varchar(256), small varchar("
                                        + smallColSize + ") for bit data, medium long varchar for bit data, large BLOB(2M)) " + tableSpaceName);
                    }
                }
                //            } catch (com.ibm.ejs.cm.portability.TableAlreadyExistsException eee) {
                //                // Do nothing since all is well!!
                //                com.ibm.ws.ffdc.FFDCFilter.processException(eee, "com.ibm.ws.session.store.db.DatabaseHashMap.createTable", "495", this);
            } catch (SQLException err) {
                com.ibm.ws.ffdc.FFDCFilter.processException(err, "com.ibm.ws.session.store.db.DatabaseHashMap.createTable", "497", this);
                if (!usingCloudScape) {
                    LoggingUtil.SESSION_LOGGER_WAS.logp(Level.SEVERE, methodClassName, methodNames[CREATE_TABLE], "CommonMessage.exception", err);
                } else {
                    if (err.getErrorCode() != 30000)
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.SEVERE, methodClassName, methodNames[CREATE_TABLE], "CommonMessage.exception", err);
                }
            }

            if (!_smc.isSessionTableSkipIndexCreation()) { // PM37139

                //Creating index in a seperate step as we have seen customers missing this
                //step when they create the table manually
                try {
                    if (s == null)
                        s = con.createStatement();
                    if (usingSybase) {
                        s.executeUpdate("create unique index sess_index on " + tableName + " (id, propid, appname)");
                        s.executeUpdate("alter table sessions lock datarows");
                    } else if (usingSolidDB) {
                        s.executeUpdate("create unique index sess_index on " + tableName + " (id, propid, appname)");
                    } else if (usingAS400DB2) {
                        mediumColSize = mediumColSize - 2; //d154211
                        //PK56991: If multiple cluster members startup at the same time the
                        // combination of these DDLs can lock up for a substantial duration.
                        // We now execute these only if they do not exist.
                        if (!doesIndexExists(con, "sess_index")) {
                            s.executeUpdate("create unique index " + collectionName + ".sess_index on " + tableName + " (id,propid,appname)"); //tableName is already in the form of "collectionName.tableName"
                            //PK56991 comment out marking table as volatile. The DB2 chief architect on iSeries
                            //team informed that VOLATILE clause is only compatible and improve performance on LUW
                            //s.executeUpdate("alter table " + tableName + " volatile");
                        } else if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[CREATE_TABLE], "Skip index creation");
                        }
                    } else if (dbHandler != null) {
                        dbHandler.createIndex(con, s, tableName);
                    } else if (!usingDB2Connect && !usingDB2zOS) { // LIDB2775.25
                        //PK56991: Refer to detailed comment above
                        if (!doesIndexExists(con, "sess_index")) {
                            s.executeUpdate("create unique index sess_index on " + tableName + " (id, propid, appname)");//PK86373: changed sesscmd_index to sess_index
                        } else if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[CREATE_TABLE], "Skip index creation");
                        }
                        //PK56991: We are marking the the session table as volatile if it is not
                        //done yet.
                        if (usingDB2 && !isTableMarkedVolatile(con)) {
                            s.executeUpdate("alter table " + tableName + " volatile");
                        } else if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[CREATE_TABLE], "Skip marking table volatile");
                        }

                    }
                } catch (SQLException err) {
                    //Don't do any thing if it is only index already exists
                    //err.printStackTrace();
                    com.ibm.ws.ffdc.FFDCFilter.processException(err, "com.ibm.ws.session.store.db.DatabaseHashMap.createTable", "526", con);
                }
            } // END PM37139
        } finally {
            if (s != null)
                closeStatement(s);
                closeConnection(con); //findbugs for 106329
        }
    }
547610
function(tableName, options = {}) {
  
    // Set Name
    if (typeof tableName !== 'string') throw new TypeError('Table name has to be a string. Need Help? Check out: discord.gg/plexidev');
    else if (tableName.includes(' ')) throw new TypeError('Table name cannot include spaces. Need Help? Check out: discord.gg/plexidev');
    this.tableName = tableName;
    
    // Methods
    this.fetch = function(key, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('fetch', {id: key, ops: ops || {}}, this.tableName);
    }
    
    this.get = function(key, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('fetch', {id: key, ops: ops || {}}, this.tableName);
    }
    
    this.set = function(key, value, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      if (!value && value != 0) throw new TypeError('No value specified. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('set', {stringify: true, id: key, data: value, ops: ops || {}}, this.tableName);
    }
    
    this.add = function(key, value, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      if (isNaN(value)) throw new TypeError('Must specify value to add. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('add', {id: key, data: value, ops: ops || {}}, this.tableName);
    }
    
    this.subtract = function(key, value, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      if (isNaN(value)) throw new TypeError('Must specify value to add. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('subtract', {id: key, data: value, ops: ops || {}}, this.tableName);
    }
    
    this.push = function(key, value, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      if (!value && value != 0) throw new TypeError('Must specify value to push. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('push', {stringify: true, id: key, data: value, ops: ops || {}}, this.tableName);
    }
    
    this.delete = function(key, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('delete', {id: key, ops: ops || {}}, this.tableName);
    }
    
    this.has = function(key, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('has', {id: key,  ops: ops || {}}, this.tableName);
    }
    
    this.includes = function(key, ops) {
      if (!key) throw new TypeError('No key specified. Need Help? Check Out: discord.gg/plexidev');
      return arbitrate('has', {id: key,  ops: ops || {}}, this.tableName);
    }
    
    this.fetchAll = function(ops) { 
      return arbitrate('all', {ops: ops || {}}, this.tableName);
    }
    
    this.all = function(ops) { 
      return arbitrate('all', {ops: ops || {}}, this.tableName);
    }
    
  }
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();
	}
675955
function generateTableInsertSQLList( $tableName, $tableDef, $dataEntries, $params, $withClosure = true )
    {
        $sqlList = eZDBSchemaInterface::generateTableInsertSQLList( $tableName, $tableDef, $dataEntries, $params, $withClosure );

        foreach ( $tableDef['fields'] as $fieldName => $fieldDef )
        {
            if ( $fieldDef['type'] == 'auto_increment' )
            {
                $sql = "SELECT setval('" . $tableName . "_{$fieldName}_seq',max(" . $fieldName . ")+1) FROM " . $tableName;
                if ( $withClosure )
                    $sql .= ";";
                $sqlList[] = $sql;
            }
        }
        return $sqlList;
    }
641104
def doSQLInsert(sqlString)
   
      sql = sqlString.dup
      dbname = ""
      state = nil
      fieldName = ""
      fieldValue = ""
      fieldNames = []
      fieldValues = []
      index = 0
      
      clearFieldValuePairList
      
      sql.gsub!("("," ")
      sql.gsub!(")"," ")

      sql.split(' ').each{ |token|
         case token
            when "INSERT", "INTO" 
               state = "getTable"
               next
            when "VALUES" 
               state = "getFieldValue"
               next
         end
         if state == "getTable"
            dbname = token.strip
            state =   "getFieldName"
         elsif state  == "getFieldName" 
            fieldName = token.dup
            fieldName.gsub!("],","")
            fieldName.gsub!('[','')
            fieldName.gsub!(']','')
            fieldName.gsub!(',','')
            fieldNames << fieldName
         elsif state  == "getFieldValue" 
            test = token.dup
            if test[-1,1] == "'" or test[-2,2] == "',"
               fieldValue << token.dup
               if fieldValue[-2,2] == "',"
                  fieldValue.gsub!("',",'')
               end
               fieldValue.gsub!('\'','')
               if fieldValue.length > 0 and fieldNames[index] 
                  addFieldValuePair(fieldNames[index],nil,nil,fieldValue)
                  fieldName = ""
                  fieldValue = ""
               end
               index += 1
            elsif token == ","
               addFieldValuePair(fieldNames[index],nil,nil,"")
               fieldName = ""
               fieldValue = ""
               index += 1
            else
               fieldValue << "#{token.dup} "
            end
         end
      }
      
      if dbname and @dbid.nil?
         dbid = findDBByname( dbname )
      else
         dbid = lookupChdbid( dbname )
      end
      dbid ||= @dbid

      recordid = nil
      if dbid
         recordid,updateid = addRecord(dbid,@fvlist)
      end   
      recordid
      
   end
991107
static function getTable($query) {
    if (!self::isWriteQuery($query)) {
      throw new DbException("Query '$query' is not a write query");
    }
    $query = " " . strtolower(preg_replace("/\\s+/i", " ", $query)) . " ";
    if (preg_match("# (update|delete from|insert into|create table|alter table|drop table) ([^ ;]+)[ ;]#i", $query, $matches)) {
      return $matches[2];
    }
    if (preg_match("# from migrations #i", $query, $matches)) {
      return "migrations";
    }
    if (preg_match("# (show tables) #i", $query, $matches)) {
      return "global";
    }
    throw new DbException("Could not identify table for query '$query'");
  }
120883
def get_sql_insert(table: str,
                   fieldlist: Sequence[str],
                   delims: Tuple[str, str] = ("", "")) -> str:
    """"""
    return (
        "INSERT INTO " + delimit(table, delims) +
        " (" +
        ",".join([delimit(x, delims) for x in fieldlist]) +
        ") VALUES (" +
        ",".join(["?"] * len(fieldlist)) +
        ")"
    )
431120
public static function table_create( $table, $fields, $if_not_exists = false ) {

		/**
		 * @var $wpdb wpdb
		 */
		global $wpdb;

		$sql = 'CREATE TABLE';

		if ( true === $if_not_exists ) {
			$sql .= ' IF NOT EXISTS';
		}

		$sql .= " `{$wpdb->prefix}" . self::$prefix . "{$table}` ({$fields})";

		if ( ! empty( $wpdb->charset ) ) {
			$sql .= " DEFAULT CHARACTER SET {$wpdb->charset}";
		}

		if ( ! empty( $wpdb->collate ) ) {
			$sql .= " COLLATE {$wpdb->collate}";
		}

		return self::query( $sql );
	}
388611
function CreateSequence($seqname = 'adodbseq', $start = 1)
  {
                $res =  $this->Execute("CREATE TABLE $seqname ( ID autoinc( 1 ) ) IN DATABASE");
                if(!$res){
                        print $this->ErrorMsg();
                        return false;
                }
                else
                        return true;

        }
513661
function (query, params, stringifier) {
    if (!query || !query.length || !params) {
      return query;
    }
    if (!stringifier) {
      stringifier = function (a) {return a.toString()};
    }
    var parts = [];
    var isLiteral = false;
    var lastIndex = 0;
    var paramsCounter = 0;
    for (var i = 0; i < query.length; i++) {
      var char = query.charAt(i);
      if (char === "'" && query.charAt(i-1) !== '\\') {
        //opening or closing quotes in a literal value of the query
        isLiteral = !isLiteral;
      }
      if (!isLiteral && char === '?') {
        //is a placeholder
        parts.push(query.substring(lastIndex, i));
        parts.push(stringifier(params[paramsCounter++]));
        lastIndex = i+1;
      }
    }
    parts.push(query.substring(lastIndex));
    return parts.join('');
  }
962733
private String buildAlterDDLQuery(TableInfo tableInfo, Map<String, String> newColumns)
    {
        String statement;
        StringBuilder builder = new StringBuilder();
        builder.append("ALTER TABLE ");
        builder.append(tableInfo.getTableName());
        builder.append(Constants.OPEN_ROUND_BRACKET);

        for (Map.Entry<String, String> entry : newColumns.entrySet())
        {
            builder.append("ADD ");
            builder.append(entry.getKey());
            builder.append(Constants.SPACE);
            String coulmnType = entry.getValue().toLowerCase();
            builder.append(OracleNoSQLValidationClassMapper.getValidType(coulmnType));
            builder.append(Constants.COMMA);
        }

        builder.deleteCharAt(builder.length() - 1);
        builder.append(Constants.CLOSE_ROUND_BRACKET);
        statement = builder.toString();
        return statement;
    }
438161
def select_from_table(fields, table, query):
    

    select_data = client.execute(f"SELECT {fields} FROM {table} {query}", with_column_types=True)

    keys = [i[0] for i in select_data[1]]

    result = []

    for i in range(len(select_data[0])):
        tmp = []

        for j in range(len(keys)):
            tmp.append(str(select_data[0][i][j]))

        result.append(dict(list(zip(keys, tmp))))

    # for i in range(len(select_data[0])):
    #     result.append(dict(list(zip(keys, select_data[0][i]))))

    return result
944109
@Override
  public String buildQuery() {
    validateQuery();

    StringBuilder stringBuilder = new StringBuilder();
    if (!Strings.isNullOrEmpty(select)) {
      stringBuilder = stringBuilder.append(SELECT).append(" ").append(select).append(" ");
    }
    if (!Strings.isNullOrEmpty(from)) {
      stringBuilder = stringBuilder.append(FROM).append(" ").append(from).append(" ");
    }
    if (!Strings.isNullOrEmpty(where)) {
      stringBuilder = stringBuilder.append(WHERE).append(" ").append(where).append(" ");
    }
    if (!Strings.isNullOrEmpty(orderBy)) {
      stringBuilder = stringBuilder.append(ORDER_BY).append(" ").append(orderBy).append(" ");
    }
    if (limit != null) {
      stringBuilder = stringBuilder.append(LIMIT).append(" ").append(limit).append(" ");
    }
    if (offset != null) {
      stringBuilder = stringBuilder.append(OFFSET).append(" ").append(offset).append(" ");
    }
    return stringBuilder.toString().trim();
  }
693142
def _create_table(self, table_name):
        ''' 
        '''
        if self.fieldnames:
            sql_fields = []
            for field in self._fields:
                if field != '_id':
                    if 'dblite' in self._fields[field]:
                        sql_fields.append(' '.join([field, self._fields[field]['dblite']]))
                    else:
                        sql_fields.append(field)
            sql_fields = ','.join(sql_fields)
            SQL = 'CREATE TABLE IF NOT EXISTS %s (%s);' % (table_name, sql_fields)
            try:
                self._cursor.execute(SQL)
            except sqlite3.OperationalError, err:
                raise RuntimeError('Create table error, %s, SQL: %s' % (err, SQL))
237866
private String buildCreateDDLQuery(TableInfo tableInfo)
    {
        String statement;
        boolean flag = false;
        StringBuilder compoundKeys = null;
        StringBuilder builder = new StringBuilder();
        builder.append("CREATE TABLE ");
        builder.append(tableInfo.getTableName());
        builder.append(Constants.OPEN_ROUND_BRACKET);

        if (!tableInfo.getTableIdType().isAnnotationPresent(Embeddable.class))
        {
            builder.append(tableInfo.getIdColumnName());
            builder.append(Constants.SPACE);
            String idType = tableInfo.getTableIdType().getSimpleName().toLowerCase();
            builder.append(OracleNoSQLValidationClassMapper.getValidIdType(idType));
            builder.append(Constants.COMMA);
        }

        for (ColumnInfo columnInfo : tableInfo.getColumnMetadatas())
        {
            builder.append(columnInfo.getColumnName());
            builder.append(Constants.SPACE);
            String coulmnType = columnInfo.getType().getSimpleName().toLowerCase();
            builder.append(OracleNoSQLValidationClassMapper.getValidType(coulmnType));
            builder.append(Constants.COMMA);
        }
        for (EmbeddedColumnInfo embeddedColumnInfo : tableInfo.getEmbeddedColumnMetadatas())
        {
            if (tableInfo.getIdColumnName().equals(embeddedColumnInfo.getEmbeddedColumnName()))
            {
                compoundKeys = new StringBuilder();
                flag = true;
            }
            for (ColumnInfo columnInfo : embeddedColumnInfo.getColumns())
            {
                builder.append(columnInfo.getColumnName());
                builder.append(Constants.SPACE);
                String coulmnType = columnInfo.getType().getSimpleName().toLowerCase();
                builder.append(OracleNoSQLValidationClassMapper.getValidType(coulmnType));
                builder.append(Constants.COMMA);
                if (flag)
                {
                    compoundKeys.append(columnInfo.getColumnName());
                    compoundKeys.append(Constants.COMMA);
                }
            }
            flag = false;
        }

        builder.append("PRIMARY KEY");
        builder.append(Constants.OPEN_ROUND_BRACKET);

        if (!tableInfo.getTableIdType().isAnnotationPresent(Embeddable.class))
        {
            builder.append(tableInfo.getIdColumnName());
        }
        else
        {
            compoundKeys.deleteCharAt(compoundKeys.length() - 1);
            builder.append(compoundKeys.toString());
        }

        builder.append(Constants.CLOSE_ROUND_BRACKET);
        builder.append(Constants.CLOSE_ROUND_BRACKET);

        statement = builder.toString();
        return statement;
    }