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 CreateKeyspaceSpecification
createKeyspace
(com.datastax.oss.driver.api.core.CqlIdentifier name) Entry point into theCreateKeyspaceSpecification
's fluent API givenname
to create a keyspace.static CreateKeyspaceSpecification
createKeyspace
(String name) Entry point into theCreateKeyspaceSpecification
's fluent API givenname
to create a keyspace.static CreateKeyspaceSpecification
Deprecated.boolean
boolean
int
hashCode()
Causes the inclusion of anIF NOT EXISTS
clause.ifNotExists
(boolean ifNotExists) Toggles the inclusion of anIF NOT EXISTS
clause.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
getOptions
Methods inherited from class org.springframework.data.cassandra.core.cql.keyspace.KeyspaceActionSpecification
canEqual, getName
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.cassandra.core.cql.keyspace.KeyspaceDescriptor
getName, getOptions
-
Method Details
-
createKeyspace
Entry point into theCreateKeyspaceSpecification
's fluent API givenname
to 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 givenname
to 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 givenname
to 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 EXISTS
clause.- Returns:
- this
-
ifNotExists
Toggles the inclusion of anIF NOT EXISTS
clause.- 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:KeyspaceOptionsSpecification
Convenience method that callswith(option, null)
.- Overrides:
with
in classKeyspaceOptionsSpecification<CreateKeyspaceSpecification>
- Returns:
- this
-
with
Description copied from class:KeyspaceOptionsSpecification
Sets the given table option. This is a convenience method that callsKeyspaceOptionsSpecification.with(String, Object, boolean, boolean)
appropriately from the givenKeyspaceOption
and value for that option.- Overrides:
with
in 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:KeyspaceOptionsSpecification
Adds 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 parameterescape
and may be single-quoted according to parameterquote
.- Overrides:
with
in 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:
equals
in classKeyspaceOptionsSpecification<CreateKeyspaceSpecification>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classKeyspaceOptionsSpecification<CreateKeyspaceSpecification>
-
createKeyspace(CqlIdentifier)