Interface IdentifierProcessing
public interface IdentifierProcessing
An interface describing the processing steps for the conversion of
SqlIdentifier
to SQL snippets or column
names.- Since:
- 2.0
- Author:
- Jens Schauder
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Encapsulates the three kinds of letter casing supported.static class
A conversion from unquoted identifiers to quoted identifiers. -
Field Summary
Modifier and TypeFieldDescriptionstatic final IdentifierProcessing
AnIdentifierProcessing
that can be used for databases adhering to the SQL standard which uses double quotes (") for quoting and makes unquoted literals equivalent to upper case.static final IdentifierProcessing
AnIdentifierProcessing
without applying transformations. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.data.relational.core.sql.DefaultIdentifierProcessing
create
(IdentifierProcessing.Quoting quoting, IdentifierProcessing.LetterCasing letterCasing) Create aIdentifierProcessing
rule givenIdentifierProcessing.Quoting
andIdentifierProcessing.LetterCasing
rules.standardizeLetterCase
(String identifier) Standardizes the use of upper and lower case letters in an identifier in such a way that semantically the same identifier results from the quoted and the unquoted version.
-
Field Details
-
ANSI
AnIdentifierProcessing
that can be used for databases adhering to the SQL standard which uses double quotes (") for quoting and makes unquoted literals equivalent to upper case. -
NONE
AnIdentifierProcessing
without applying transformations.
-
-
Method Details
-
create
static org.springframework.data.relational.core.sql.DefaultIdentifierProcessing create(IdentifierProcessing.Quoting quoting, IdentifierProcessing.LetterCasing letterCasing) Create aIdentifierProcessing
rule givenIdentifierProcessing.Quoting
andIdentifierProcessing.LetterCasing
rules.- Parameters:
quoting
- quoting rules.letterCasing
-IdentifierProcessing.LetterCasing
rules for identifier normalization.- Returns:
- a new
IdentifierProcessing
object.
-
quote
Converts aString
representing a bare name of an identifier to aString
with proper quoting applied.- Parameters:
identifier
- the name of an identifier. Must not be null.- Returns:
- a quoted name of an identifier. Guaranteed to be not null.
-
standardizeLetterCase
Standardizes the use of upper and lower case letters in an identifier in such a way that semantically the same identifier results from the quoted and the unquoted version. If this is not possible use ofIdentifierProcessing.LetterCasing.AS_IS
is recommended.- Parameters:
identifier
- an identifier with arbitrary upper and lower cases. must not be null.- Returns:
- an identifier with standardized use of upper and lower case letter. Guaranteed to be not null.
-