public interface SqlIdentifier
name
with specifying whether the name should be quoted or unquoted.
SqlIdentifier
renders its name using IdentifierProcessing
rules. Use
getReference(IdentifierProcessing)
to refer to an object using the identifier when e.g. obtaining values
from a result or providing values for a prepared statement. toSql(IdentifierProcessing)
renders the
identifier for SQL statement usage.
SqlIdentifier
objects are immutable. Calling transformational methods such as
transform(UnaryOperator)
creates a new instance.
Modifier and Type | Field and Description |
---|---|
static SqlIdentifier |
EMPTY
Null-object.
|
Modifier and Type | Method and Description |
---|---|
static SqlIdentifier |
from(SqlIdentifier... sqlIdentifiers)
Create a new composite
SqlIdentifier from one or more SqlIdentifier s. |
default String |
getReference()
Return the reference name without any further transformation.
|
String |
getReference(IdentifierProcessing processing)
Return the reference name after applying
IdentifierProcessing rules. |
static SqlIdentifier |
quoted(String name)
Create a new quoted identifier given
name . |
String |
toSql(IdentifierProcessing processing)
Return the identifier for SQL usage after applying
IdentifierProcessing rules. |
SqlIdentifier |
transform(UnaryOperator<String> transformationFunction)
Transform the SQL identifier name by applying a
transformation function . |
static SqlIdentifier |
unquoted(String name)
Create a new unquoted identifier given
name . |
static final SqlIdentifier EMPTY
String getReference(IdentifierProcessing processing)
IdentifierProcessing
rules. The reference name is used for
programmatic access to the object identified by this SqlIdentifier
.processing
- identifier processing rules.default String getReference()
SqlIdentifier
.IdentifierProcessing.NONE
String toSql(IdentifierProcessing processing)
IdentifierProcessing
rules. The identifier name is used
to construct SQL statements.processing
- identifier processing rules.SqlIdentifier transform(UnaryOperator<String> transformationFunction)
transformation function
. The transformation
function must return a valid, non-null identifier String
.transformationFunction
- the transformation function. Must return a non-null identifier
String
.SqlIdentifier
with the transformation applied.static SqlIdentifier quoted(String name)
name
.name
- the identifier.name
.static SqlIdentifier unquoted(String name)
name
.name
- the identifier.name
.static SqlIdentifier from(SqlIdentifier... sqlIdentifiers)
SqlIdentifier
from one or more SqlIdentifier
s.
Composite identifiers do not allow transform(UnaryOperator)
transformation.
sqlIdentifiers
- the elements of the new identifier.Copyright © 2017–2020 Pivotal Software, Inc.. All rights reserved.