Added the CqlGenerators for Keyspace.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
package org.springframework.cassandra.core.keyspace;
|
||||
|
||||
public class AlterKeyspaceSpecification extends KeyspaceSpecification<AlterKeyspaceSpecification> {
|
||||
public class AlterKeyspaceSpecification extends KeyspaceOptionsSpecification<AlterKeyspaceSpecification> {
|
||||
|
||||
}
|
||||
|
||||
@@ -2,4 +2,29 @@ package org.springframework.cassandra.core.keyspace;
|
||||
|
||||
public class CreateKeyspaceSpecification extends KeyspaceSpecification<CreateKeyspaceSpecification> {
|
||||
|
||||
private boolean ifNotExists = false;
|
||||
|
||||
/**
|
||||
* Causes the inclusion of an <code>IF NOT EXISTS</code> clause.
|
||||
*
|
||||
* @return this
|
||||
*/
|
||||
public CreateKeyspaceSpecification ifNotExists() {
|
||||
return ifNotExists(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the inclusion of an <code>IF NOT EXISTS</code> clause.
|
||||
*
|
||||
* @return this
|
||||
*/
|
||||
public CreateKeyspaceSpecification ifNotExists(boolean ifNotExists) {
|
||||
this.ifNotExists = ifNotExists;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getIfNotExists() {
|
||||
return ifNotExists;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,4 +2,19 @@ package org.springframework.cassandra.core.keyspace;
|
||||
|
||||
public class DropKeyspaceSpecification extends KeyspaceNameSpecification<DropKeyspaceSpecification> {
|
||||
|
||||
private boolean ifExists;
|
||||
|
||||
public DropKeyspaceSpecification ifExists() {
|
||||
return ifExists(true);
|
||||
}
|
||||
|
||||
public DropKeyspaceSpecification ifExists(boolean ifExists) {
|
||||
this.ifExists = ifExists;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getIfExists() {
|
||||
return ifExists;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,10 +22,12 @@ import org.springframework.cassandra.core.cql.CqlStringUtils;
|
||||
* @author John McPeek
|
||||
* @param <T> The subtype of the {@link KeyspaceOptionsSpecification}.
|
||||
*/
|
||||
public abstract class KeyspaceOptionsSpecification<T extends KeyspaceOptionsSpecification<T>> extends KeyspaceNameSpecification<T> {
|
||||
public abstract class KeyspaceOptionsSpecification<T extends KeyspaceOptionsSpecification<T>> extends
|
||||
KeyspaceNameSpecification<KeyspaceOptionsSpecification<T>> {
|
||||
|
||||
protected Map<String, Object> options = new LinkedHashMap<String, Object>();
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public T name(String name) {
|
||||
return (T) super.name(name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user