public class DelimitedNameTranslator extends java.lang.Object implements NameTranslator
setOpeningDelimiter(String)
and setClosingDelimiter(String)
.
They are double quotes by default.
Case is preserved. Use UpperCaseNameTranslator
or LowerCaseNameTranslator
in addition to this class to force a specific case. With most databases a delimited identifier
is case-sensitive.
Constructor and Description |
---|
DelimitedNameTranslator()
Constructs for default opening and closing delimiters of double quotes.
|
DelimitedNameTranslator(java.lang.String openingDelimiter,
java.lang.String closingDelimiter) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getClosingDelimiter()
Gets the closing delimiter.
|
java.lang.String |
getOpeningDelimiter()
Gets the opening delimiter.
|
void |
setClosingDelimiter(java.lang.String closingDelimiter)
Sets the closing delimiter.
|
void |
setOpeningDelimiter(java.lang.String openingDelimiter)
Sets the opening delimiter.
|
java.lang.String |
translate(java.lang.String name,
java.lang.Class rowClass)
Provides SQL name for corresponding name
|
public DelimitedNameTranslator()
public DelimitedNameTranslator(java.lang.String openingDelimiter, java.lang.String closingDelimiter)
public java.lang.String translate(java.lang.String name, java.lang.Class rowClass)
translate
in interface NameTranslator
name
- name to convert (for example, Java class or member name)rowClass
- class for row objects (not parameterized so that NameTranslator
may be used in annotations)public java.lang.String getOpeningDelimiter()
public void setOpeningDelimiter(java.lang.String openingDelimiter)
openingDelimiter
- string to precede namepublic java.lang.String getClosingDelimiter()
public void setClosingDelimiter(java.lang.String closingDelimiter)
closingDelimiter
- string to follow name