/** * Define the new type of the altered column. * * @param type the new type of the altered column. * @return the final statement. */ public SchemaStatement type(DataType type) { return SchemaStatement.fromQueryString( alter.buildInternal() + " ALTER " + columnName + " TYPE " + type.toString()); }
/** * Define the type of the added column. * * @param type the type of the added column. * @return the final statement. */ public SchemaStatement type(DataType type) { return SchemaStatement.fromQueryString( alter.buildInternal() + " ADD " + columnName + " " + type.toString() + (staticColumn ? " static" : "")); }
/** * Define the new type of the altered column, when that type contains a UDT. * * @param udtType the UDT type. Use {@link SchemaBuilder#frozen(String)} or {@link * SchemaBuilder#udtLiteral(String)}. * @return the final statement. */ public SchemaStatement udtType(UDTType udtType) { return SchemaStatement.fromQueryString( alter.buildInternal() + " ALTER " + columnName + " TYPE " + udtType.asCQLString()); } }
/** * Define the type of the added column, when that type contains a UDT. * * @param udtType the UDT type of the added column. * @return the final statement. */ public SchemaStatement udtType(UDTType udtType) { return SchemaStatement.fromQueryString( alter.buildInternal() + " ADD " + columnName + " " + udtType.asCQLString() + (staticColumn ? " static" : "")); } }
/** * Specify the column to create the index on. * * @param columnName the column name. * @return the final CREATE INDEX statement. */ public SchemaStatement andColumn(String columnName) { validateNotEmpty(columnName, "Column name"); validateNotKeyWord( columnName, String.format( "The column name '%s' is not allowed because it is a reserved keyword", columnName)); CreateIndex.this.columnName = columnName; return SchemaStatement.fromQueryString(buildInternal()); }
/** * Create an index on the keys of the given map column. * * @param columnName the column name. * @return the final CREATE INDEX statement. */ public SchemaStatement andKeysOfColumn(String columnName) { validateNotEmpty(columnName, "Column name"); validateNotKeyWord( columnName, String.format( "The column name '%s' is not allowed because it is a reserved keyword", columnName)); CreateIndex.this.columnName = columnName; CreateIndex.this.keys = true; return SchemaStatement.fromQueryString(buildInternal()); } }
/** * Define the new name of the column. * * @param newColumnName the new name of the column. * @return the final statement. */ public SchemaStatement to(String newColumnName) { validateNotEmpty(newColumnName, "New column name"); validateNotKeyWord( newColumnName, String.format( "The new column name '%s' is not allowed because it is a reserved keyword", newColumnName)); return SchemaStatement.fromQueryString( alter.buildInternal() + " RENAME " + columnName + " TO " + newColumnName); } }
/** * Add a new DROP column clause to this ALTER TABLE statement. * * <p>Note that you cannot drop a column that is part of the primary key. * * @param columnName the name of the column to be dropped. * @return the final ALTER TABLE DROP COLUMN statement. */ public SchemaStatement dropColumn(String columnName) { validateNotEmpty(columnName, "Column to be dropped"); validateNotKeyWord( columnName, String.format( "The dropped column name '%s' is not allowed because it is a reserved keyword", columnName)); return SchemaStatement.fromQueryString(buildInternal() + " DROP " + columnName); }
/** * Define the new type of the altered column. * * @param type the new type of the altered column. * @return the final statement. */ public SchemaStatement type(DataType type) { return SchemaStatement.fromQueryString( alter.buildInternal() + " ALTER " + columnName + " TYPE " + type.toString()); }
/** * Define the new type of the altered column. * * @param type the new type of the altered column. * @return the final statement. */ public SchemaStatement type(DataType type) { return SchemaStatement.fromQueryString( alter.buildInternal() + " ALTER " + columnName + " TYPE " + type.toString()); }
/** * Define the type of the added column. * * @param type the type of the added column. * @return the final statement. */ public SchemaStatement type(DataType type) { return SchemaStatement.fromQueryString( alter.buildInternal() + " ADD " + columnName + " " + type.toString() + (staticColumn ? " static" : "")); }
/** * Define the new type of the altered column. * * @param type the new type of the altered column. * @return the final statement. */ public SchemaStatement type(DataType type) { return SchemaStatement.fromQueryString( alter.buildInternal() + " ALTER " + columnName + " TYPE " + type.toString()); }
/** * Define the type of the added column. * * @param type the type of the added column. * @return the final statement. */ public SchemaStatement type(DataType type) { return SchemaStatement.fromQueryString( alter.buildInternal() + " ADD " + columnName + " " + type.toString() + (staticColumn ? " static" : "")); }
/** * Define the type of the added column. * * @param type the type of the added column. * @return the final statement. */ public SchemaStatement type(DataType type) { return SchemaStatement.fromQueryString( alter.buildInternal() + " ADD " + columnName + " " + type.toString() + (staticColumn ? " static" : "")); }
/** * Define the new type of the altered column, when that type contains a UDT. * * @param udtType the UDT type. Use {@link SchemaBuilder#frozen(String)} or {@link SchemaBuilder#udtLiteral(String)}. * @return the final statement. */ public SchemaStatement udtType(UDTType udtType) { return SchemaStatement.fromQueryString( alter.buildInternal() + " ALTER " + columnName + " TYPE " + udtType.asCQLString()); } }
/** * Define the type of the added column, when that type contains a UDT. * * @param udtType the UDT type of the added column. * @return the final statement. */ public SchemaStatement udtType(UDTType udtType) { return SchemaStatement.fromQueryString( alter.buildInternal() + " ADD " + columnName + " " + udtType.asCQLString() + (staticColumn ? " static" : "")); } }
/** * Define the new type of the altered column, when that type contains a UDT. * * @param udtType the UDT type. Use {@link SchemaBuilder#frozen(String)} or {@link SchemaBuilder#udtLiteral(String)}. * @return the final statement. */ public SchemaStatement udtType(UDTType udtType) { return SchemaStatement.fromQueryString( alter.buildInternal() + " ALTER " + columnName + " TYPE " + udtType.asCQLString()); } }
/** * Define the type of the added column, when that type contains a UDT. * * @param udtType the UDT type of the added column. * @return the final statement. */ public SchemaStatement udtType(UDTType udtType) { return SchemaStatement.fromQueryString( alter.buildInternal() + " ADD " + columnName + " " + udtType.asCQLString() + (staticColumn ? " static" : "")); } }
/** * Specify the column to create the index on. * * @param columnName the column name. * @return the final CREATE INDEX statement. */ public SchemaStatement andColumn(String columnName) { validateNotEmpty(columnName, "Column name"); validateNotKeyWord(columnName, String.format("The column name '%s' is not allowed because it is a reserved keyword", columnName)); CreateIndex.this.columnName = columnName; return SchemaStatement.fromQueryString(buildInternal()); }
/** * Specify the column to create the index on. * * @param columnName the column name. * @return the final CREATE INDEX statement. */ public SchemaStatement andColumn(String columnName) { validateNotEmpty(columnName, "Column name"); validateNotKeyWord(columnName, String.format("The column name '%s' is not allowed because it is a reserved keyword", columnName)); CreateIndex.this.columnName = columnName; return SchemaStatement.fromQueryString(buildInternal()); }