/** * Entry point into the {@link DropTableSpecification}'s fluent API given {@code tableName} to drop a table. * Convenient if imported statically. * * @param tableName must not be {@literal null}. * @return a new {@link DropTableSpecification}. */ public static DropTableSpecification dropTable(CqlIdentifier tableName) { return new DropTableSpecification(tableName); }
/** * Causes the inclusion of an {@code IF EXISTS} clause. * * @return this * @since 2.1 */ public DropTableSpecification ifExists() { return ifExists(true); }
@Override public StringBuilder toCql(StringBuilder cql) { DropTableSpecification specification = spec(); return cql.append("DROP TABLE ") .append(specification.getIfExists() ? "IF EXISTS " : "") .append(specification.getName()).append(";"); } }
/** * Entry point into the {@link DropTableSpecification}'s fluent API {@code tableName} to drop a table. Convenient if * imported statically. * * @param tableName must not be {@literal null} or empty. * @return a new {@link DropTableSpecification}. */ public static DropTableSpecification dropTable(String tableName) { return dropTable(CqlIdentifier.of(tableName)); }