/** * Adds a {@code RENAME} to the list of column changes. * * @param from must not be {@literal null} or empty. * @param to must not be {@literal null} or empty. * @return {@literal this} {@link AlterTableSpecification}. */ public AlterTableSpecification rename(String from, String to) { return rename(CqlIdentifier.of(from), CqlIdentifier.of(to)); }
/** * Adds an {@literal RENAME} to the list of field changes. * * @param from must not be {@literal null} or empty. * @param to must not be {@literal null} or empty. * @return {@code this} {@link AlterUserTypeSpecification}. */ public AlterUserTypeSpecification rename(String from, String to) { return rename(CqlIdentifier.of(from), CqlIdentifier.of(to)); }
/** * Entry point into the {@link DropUserTypeSpecification}'s fluent API given {@code name} to drop a type. Convenient * if imported statically. * * @param name must not be {@link null} or empty. * @return a new {@link DropUserTypeSpecification}. */ public static DropUserTypeSpecification dropType(String name) { return new DropUserTypeSpecification(CqlIdentifier.of(name)); }
/** * Create a new {@link DropIndexSpecification} for the given {@code indexName}. * * @param indexName must not be {@literal null} or empty. * @return a new {@link DropIndexSpecification}. */ public static DropIndexSpecification dropIndex(String indexName) { return dropIndex(CqlIdentifier.of(indexName)); }
/** * Create a {@link ColumnSelector} for the current {@link #getExpression() expression} aliased as {@code alias}. * * @param alias must not be {@literal null} or empty. * @return the aliased {@link ColumnSelector}. */ public ColumnSelector as(String alias) { return as(CqlIdentifier.of(alias)); }
/** * Create a new {@link ColumnSpecification} for the given {@code name}. * * @param name must not be {@literal null} or empty. * @return a new {@link ColumnSpecification} for {@code name}. */ public static ColumnSpecification name(String name) { return name(of(name)); }
/** * Entry point into the {@link AlterColumnSpecification}'s fluent API given {@code name} and {@link DataType} to alter * a column. Convenient if imported statically. * * @param name must not be {@literal null} or empty. * @param type must not be {@literal null}. * @return a new {@link AlterColumnSpecification}. */ public static AlterColumnSpecification alterColumn(String name, DataType type) { return alterColumn(CqlIdentifier.of(name), type); }
/** * Entry point into the {@link AlterTableSpecification}'s fluent API given {@code tableName} to alter a table. * Convenient if imported statically. * * @param tableName must not be {@literal null} or empty. * @return a new {@link AlterTableSpecification}. */ public static AlterTableSpecification alterTable(String tableName) { return alterTable(CqlIdentifier.of(tableName)); }
/** * Adds the given field to the type. * * @param name must not be {@literal null} or empty. * @param type The data type of the field. * @return {@code this} specification. */ public T field(String name, DataType type) { return field(of(name), type); }
/** * Create a new {@link AddColumnSpecification} for the given {@code name} and {@link DataType}. * * @param name must not be {@literal null} or empty. * @param type must not be {@literal null}. * @return a new {@link AddColumnSpecification}. */ public static AddColumnSpecification addColumn(String name, DataType type) { return addColumn(CqlIdentifier.of(name), type); }
/** * Sets the table name. * * @param tableName must not be {@literal null} or empty. * @return this */ public CreateIndexSpecification tableName(String tableName) { return tableName(of(tableName)); }
/** * Sets the column name. * * @param columnName must not be {@literal null} or empty. * @return this */ public CreateIndexSpecification columnName(String columnName) { return columnName(of(columnName)); }
/** * Adds an {@literal ADD} to the list of field changes. * * @param field must not be {@literal null} or empty. * @param type must not be {@literal null}. * @return {@code this} {@link AlterUserTypeSpecification}. */ public AlterUserTypeSpecification add(String field, DataType type) { return add(CqlIdentifier.of(field), type); }
/** * Adds an {@literal ALTER} to the list of field changes. * * @param field must not be {@literal null} or empty. * @param type must not be {@literal null}. * @return {@code this} {@link AlterUserTypeSpecification}. */ public AlterUserTypeSpecification alter(String field, DataType type) { return alter(CqlIdentifier.of(field), type); }
/** * Entry point into the {@link CreateTableSpecification}'s fluent API given {@code tableName} to create a table. * Convenient if imported statically. * * @param tableName must not be {@literal null} or empty. * @return a new {@link CreateTableSpecification}. */ public static CreateTableSpecification createTable(String tableName) { return new CreateTableSpecification(CqlIdentifier.of(tableName)); }
/** * Adds the given primary key column to the table with ascending ordering. Must be specified after all partition key * columns and before any non-key columns. * * @param name The column name; must be a valid unquoted or quoted identifier without the surrounding double quotes, * must not be {@literal null}. * @param type The data type of the column, must not be {@literal null}. * @return this */ public T clusteredKeyColumn(String name, DataType type) { return clusteredKeyColumn(of(name), type); }
/** * Entry point into the {@link AlterColumnSpecification}'s fluent API given {@code typeName} to alter a user type. * Convenient if imported statically. * * @param typeName must not be {@literal null} or empty. * @return a new {@link AlterUserTypeSpecification}. */ public static AlterUserTypeSpecification alterType(String typeName) { return alterType(CqlIdentifier.of(typeName)); }
/** * Create a new {@link FieldSpecification} for the given {@code name} and {@link DataType} * * @param name must not be {@literal null} or empty. * @param type must not be {@literal null}. */ public static FieldSpecification of(String name, DataType type) { return new FieldSpecification(CqlIdentifier.of(name), type); }
/** * Create a new {@link DropColumnSpecification} for the given {@code name}. * * @param name must not be {@literal null} or empty. */ public static DropColumnSpecification dropColumn(String name) { return dropColumn(CqlIdentifier.of(name)); }