/** * 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(CqlIdentifier name) { return new DropUserTypeSpecification(name); }
/** * Enables the inclusion of an{@code IF EXISTS} clause. * * @return this {@link DropUserTypeSpecification}. */ public DropUserTypeSpecification ifExists() { return ifExists(true); }
@Override public StringBuilder toCql(StringBuilder cql) { return cql.append("DROP TYPE").append(spec().getIfExists() ? " IF EXISTS " : " ").append(spec().getName()) .append(";"); } }
@Override public void dropUserType(CqlIdentifier typeName) { Assert.notNull(typeName, "Type name must not be null"); String dropUserTypeCql = DropUserTypeCqlGenerator.toCql(DropUserTypeSpecification.dropType(typeName)); getCqlOperations().execute(dropUserTypeCql); }
/** * 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)); }