Class CreateKeyspaceSpecification
java.lang.Object
org.springframework.data.cassandra.core.cql.keyspace.KeyspaceActionSpecification
org.springframework.data.cassandra.core.cql.keyspace.KeyspaceOptionsSpecification<CreateKeyspaceSpecification>
org.springframework.data.cassandra.core.cql.keyspace.CreateKeyspaceSpecification
- All Implemented Interfaces:
KeyspaceDescriptor
public class CreateKeyspaceSpecification
extends KeyspaceOptionsSpecification<CreateKeyspaceSpecification>
implements KeyspaceDescriptor
Object to configure a
CREATE KEYSPACE specification.- Author:
- Mark Paluch
-
Field Summary
Fields inherited from class org.springframework.data.cassandra.core.cql.keyspace.KeyspaceOptionsSpecification
options -
Method Summary
Modifier and TypeMethodDescriptionstatic CreateKeyspaceSpecificationcreateKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier name) Entry point into theCreateKeyspaceSpecification's fluent API givennameto create a keyspace.static CreateKeyspaceSpecificationcreateKeyspace(String name) Entry point into theCreateKeyspaceSpecification's fluent API givennameto create a keyspace.static CreateKeyspaceSpecificationDeprecated.booleanbooleaninthashCode()Causes the inclusion of anIF NOT EXISTSclause.ifNotExists(boolean ifNotExists) Toggles the inclusion of anIF NOT EXISTSclause.Adds the given option by name to this keyspaces's options.with(KeyspaceOption option) Convenience method that callswith(option, null).with(KeyspaceOption option, Object value) Sets the given table option.Configure datacenter replication givenDataCenterReplication.Configure simple replication with a replication factor of1.withSimpleReplication(long replicationFactor) Configure simple replication with areplicationFactor.Methods inherited from class org.springframework.data.cassandra.core.cql.keyspace.KeyspaceOptionsSpecification
getOptionsMethods inherited from class org.springframework.data.cassandra.core.cql.keyspace.KeyspaceActionSpecification
canEqual, getNameMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.cassandra.core.cql.keyspace.KeyspaceDescriptor
getName, getOptions
-
Method Details
-
createKeyspace
Entry point into theCreateKeyspaceSpecification's fluent API givennameto create a keyspace. Convenient if imported statically.- Parameters:
name- must not be null or empty.- Returns:
- a new
CreateKeyspaceSpecification.
-
createKeyspace
Deprecated.since 3.0, usecreateKeyspace(CqlIdentifier)Entry point into theCreateKeyspaceSpecification's fluent API givennameto create a keyspace. Convenient if imported statically.- Parameters:
name- must not be null.- Returns:
- a new
CreateKeyspaceSpecification.
-
createKeyspace
public static CreateKeyspaceSpecification createKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier name) Entry point into theCreateKeyspaceSpecification's fluent API givennameto create a keyspace. Convenient if imported statically.- Parameters:
name- must not be null.- Returns:
- a new
CreateKeyspaceSpecification. - Since:
- 3.0
-
ifNotExists
Causes the inclusion of anIF NOT EXISTSclause.- Returns:
- this
-
ifNotExists
Toggles the inclusion of anIF NOT EXISTSclause.- Returns:
- this
-
getIfNotExists
public boolean getIfNotExists() -
withSimpleReplication
Configure simple replication with a replication factor of1.- Returns:
- this.
-
withSimpleReplication
Configure simple replication with areplicationFactor.- Returns:
- this.
-
withNetworkReplication
Configure datacenter replication givenDataCenterReplication.- Returns:
- this.
-
with
Description copied from class:KeyspaceOptionsSpecificationConvenience method that callswith(option, null).- Overrides:
within classKeyspaceOptionsSpecification<CreateKeyspaceSpecification>- Returns:
- this
-
with
Description copied from class:KeyspaceOptionsSpecificationSets the given table option. This is a convenience method that callsKeyspaceOptionsSpecification.with(String, Object, boolean, boolean)appropriately from the givenKeyspaceOptionand value for that option.- Overrides:
within classKeyspaceOptionsSpecification<CreateKeyspaceSpecification>- Parameters:
option- The option to set.value- The value of the option. Must be type-compatible with theKeyspaceOption.- Returns:
- this
- See Also:
-
with
public CreateKeyspaceSpecification with(String name, @Nullable Object value, boolean escape, boolean quote) Description copied from class:KeyspaceOptionsSpecificationAdds the given option by name to this keyspaces's options.Options that have null values are considered single string options where the name of the option is the string to be used. Otherwise, the result of
Object.toString()is considered to be the value of the option with the given name. The value, after conversion to string, may have embedded single quotes escaped according to parameterescapeand may be single-quoted according to parameterquote.- Overrides:
within classKeyspaceOptionsSpecification<CreateKeyspaceSpecification>- Parameters:
name- The name of the optionvalue- The value of the option. If null, the value is ignored and the option is considered to be composed of only the name, otherwise the value'sObject.toString()value is used.escape- Whether to escape the value viaCqlStringUtils.escapeSingle(Object). Ignored if given value is an instance of aMap.quote- Whether to quote the value viaCqlStringUtils.singleQuote(Object). Ignored if given value is an instance of aMap.- Returns:
- this
-
equals
- Overrides:
equalsin classKeyspaceOptionsSpecification<CreateKeyspaceSpecification>
-
hashCode
public int hashCode()- Overrides:
hashCodein classKeyspaceOptionsSpecification<CreateKeyspaceSpecification>
-
createKeyspace(CqlIdentifier)