@Immutable public class DefaultCreateDseFunction extends Object implements CreateDseFunctionEnd, CreateDseFunctionStart, CreateDseFunctionWithLanguage, CreateDseFunctionWithNullOption, CreateDseFunctionWithType
DefaultCreateFunction
implementation, with
the additional DSE specific extended functionality (DETERMINISTIC and MONOTONIC keywords).Constructor and Description |
---|
DefaultCreateDseFunction(com.datastax.oss.driver.api.core.CqlIdentifier functionName) |
DefaultCreateDseFunction(com.datastax.oss.driver.api.core.CqlIdentifier keyspace,
com.datastax.oss.driver.api.core.CqlIdentifier functionName) |
DefaultCreateDseFunction(com.datastax.oss.driver.api.core.CqlIdentifier keyspace,
com.datastax.oss.driver.api.core.CqlIdentifier functionName,
boolean orReplace,
boolean ifNotExists,
com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap<com.datastax.oss.driver.api.core.CqlIdentifier,com.datastax.oss.driver.api.core.type.DataType> parameters,
boolean returnsNullOnNull,
com.datastax.oss.driver.api.core.type.DataType returns,
String language,
String functionBody,
boolean deterministic,
boolean globallyMonotonic,
com.datastax.oss.driver.api.core.CqlIdentifier monotonicOn) |
Modifier and Type | Method and Description |
---|---|
CreateDseFunctionEnd |
as(String functionBody)
Adds AS to the create function specification.
|
String |
asCql() |
CreateDseFunctionWithNullOption |
calledOnNull()
Adds CALLED ON NULL to the create function specification.
|
CreateDseFunctionWithType |
deterministic()
Adds "DETERMINISTIC" to create function specification.
|
com.datastax.oss.driver.api.core.CqlIdentifier |
getFunction() |
String |
getFunctionBody() |
com.datastax.oss.driver.api.core.CqlIdentifier |
getKeyspace() |
String |
getLanguage() |
com.datastax.oss.driver.api.core.CqlIdentifier |
getMonotonicOn() |
com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap<com.datastax.oss.driver.api.core.CqlIdentifier,com.datastax.oss.driver.api.core.type.DataType> |
getParameters() |
com.datastax.oss.driver.api.core.type.DataType |
getReturnType() |
CreateDseFunctionStart |
ifNotExists()
Adds IF NOT EXISTS to the create function specification.
|
boolean |
isDeterministic() |
boolean |
isGloballyMonotonic() |
boolean |
isIfNotExists() |
boolean |
isOrReplace() |
boolean |
isReturnsNullOnNull() |
CreateDseFunctionWithType |
monotonic()
Adds "MONOTONIC" to create function specification.
|
CreateDseFunctionWithType |
monotonicOn(com.datastax.oss.driver.api.core.CqlIdentifier monotonicColumn)
Adds "MONOTONIC ON" to create function specification.
|
CreateDseFunctionStart |
orReplace()
Adds OR REPLACE to the create function specification.
|
CreateDseFunctionWithNullOption |
returnsNullOnNull()
Adds RETURNS NULL ON NULL to the create function specification.
|
CreateDseFunctionWithType |
returnsType(com.datastax.oss.driver.api.core.type.DataType returnType)
Adds RETURNS to the create function specification.
|
String |
toString() |
CreateDseFunctionWithLanguage |
withLanguage(String language)
Adds LANGUAGE to the create function specification.
|
CreateDseFunctionStart |
withParameter(com.datastax.oss.driver.api.core.CqlIdentifier paramName,
com.datastax.oss.driver.api.core.type.DataType paramType)
Adds a parameter definition in the CREATE FUNCTION statement.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
build, builder
withParameter
asQuoted
monotonicOn, withJavaLanguage, withJavaScriptLanguage
public DefaultCreateDseFunction(com.datastax.oss.driver.api.core.CqlIdentifier functionName)
public DefaultCreateDseFunction(com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier functionName)
public DefaultCreateDseFunction(com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier functionName, boolean orReplace, boolean ifNotExists, com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap<com.datastax.oss.driver.api.core.CqlIdentifier,com.datastax.oss.driver.api.core.type.DataType> parameters, boolean returnsNullOnNull, com.datastax.oss.driver.api.core.type.DataType returns, String language, String functionBody, boolean deterministic, boolean globallyMonotonic, com.datastax.oss.driver.api.core.CqlIdentifier monotonicOn)
@NonNull public String asCql()
asCql
in interface com.datastax.oss.driver.api.querybuilder.BuildableQuery
@NonNull public CreateDseFunctionEnd as(@NonNull String functionBody)
CreateDseFunctionWithLanguage
'myBody'
. If the body itself contains single quotes, one could use a
postgres-style string literal, which is surrounded in two dollar signs, i.e. $$ myBody $$
.as
in interface CreateDseFunctionWithLanguage
@NonNull public CreateDseFunctionWithLanguage withLanguage(@NonNull String language)
CreateDseFunctionWithType
withLanguage
in interface CreateDseFunctionWithType
@NonNull public CreateDseFunctionStart ifNotExists()
CreateDseFunctionStart
ifNotExists
in interface CreateDseFunctionStart
@NonNull public CreateDseFunctionStart orReplace()
CreateDseFunctionStart
orReplace
in interface CreateDseFunctionStart
@NonNull public CreateDseFunctionStart withParameter(@NonNull com.datastax.oss.driver.api.core.CqlIdentifier paramName, @NonNull com.datastax.oss.driver.api.core.type.DataType paramType)
CreateDseFunctionStart
Parameter keys are added in the order of their declaration.
To create the data type, use the constants and static methods in DataTypes
, or
SchemaBuilder.udt(CqlIdentifier, boolean)
.
withParameter
in interface CreateDseFunctionStart
@NonNull public CreateDseFunctionWithNullOption returnsNullOnNull()
CreateDseFunctionStart
returnsNullOnNull
in interface CreateDseFunctionStart
@NonNull public CreateDseFunctionWithNullOption calledOnNull()
CreateDseFunctionStart
calledOnNull
in interface CreateDseFunctionStart
@NonNull public CreateDseFunctionWithType deterministic()
CreateDseFunctionWithType
deterministic
in interface CreateDseFunctionWithType
@NonNull public CreateDseFunctionWithType monotonic()
CreateDseFunctionWithType
monotonic
in interface CreateDseFunctionWithType
@NonNull public CreateDseFunctionWithType monotonicOn(com.datastax.oss.driver.api.core.CqlIdentifier monotonicColumn)
CreateDseFunctionWithType
CreateDseFunctionWithType.monotonic()
instead.monotonicOn
in interface CreateDseFunctionWithType
public CreateDseFunctionWithType returnsType(com.datastax.oss.driver.api.core.type.DataType returnType)
CreateDseFunctionWithNullOption
To create the data type, use the constants and static methods in DataTypes
, or
SchemaBuilder.udt(CqlIdentifier, boolean)
.
returnsType
in interface CreateDseFunctionWithNullOption
@Nullable public com.datastax.oss.driver.api.core.CqlIdentifier getKeyspace()
@NonNull public com.datastax.oss.driver.api.core.CqlIdentifier getFunction()
public boolean isOrReplace()
public boolean isIfNotExists()
@NonNull public com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap<com.datastax.oss.driver.api.core.CqlIdentifier,com.datastax.oss.driver.api.core.type.DataType> getParameters()
public boolean isReturnsNullOnNull()
@Nullable public com.datastax.oss.driver.api.core.type.DataType getReturnType()
@Nullable public String getLanguage()
@Nullable public String getFunctionBody()
public boolean isDeterministic()
public boolean isGloballyMonotonic()
@Nullable public com.datastax.oss.driver.api.core.CqlIdentifier getMonotonicOn()
Copyright © 2017–2019. All rights reserved.