public class Metadata
extends java.lang.Object
Constructor and Description |
---|
Metadata() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
quote(java.lang.String id)
Quote a keyspace, table or column identifier to make it case sensitive.
|
public static java.lang.String quote(java.lang.String id)
CQL identifiers, including keyspace, table and column ones, are case insensitive by default. Case sensitive identifiers can however be provided by enclosing the identifier in double quotes (see the CQL documentation for details). If you are using case sensitive identifiers, this method can be used to enclose such identifiers in double quotes, making them case sensitive.
Note that reserved CQL
keywords should also be quoted. You can check if a given identifier is a reserved keyword
by calling #isReservedCqlKeyword(String)
.
id
- the keyspace or table identifier.id
enclosed in double-quotes, for use in methods like #getReplicas
,
#getKeyspace
, KeyspaceMetadata#getTable
or even Cluster#connect(String)
.Copyright © 2009-2022 The Apache Software Foundation