Class IdentifierRule
- java.lang.Object
-
- org.apache.openjpa.lib.identifier.IdentifierRule
-
- Direct Known Subclasses:
DBIdentifierRule
public class IdentifierRule extends java.lang.Object
The standard identifier rule. Rules are used for specific configuration of identifier types. For example. A rule could be used to indicate that an identifier type should not be delimited or has a max length of 255 characters.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_RULE
static java.util.Set<java.lang.String>
EMPTY_SET
static char
UNDERSCORE
-
Constructor Summary
Constructors Constructor Description IdentifierRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getAllowCompaction()
boolean
getCanDelimit()
boolean
getDelimitReservedWords()
int
getMaxLength()
boolean
getMustDelimit()
java.lang.String
getName()
java.util.Set<java.lang.String>
getReservedWords()
java.lang.String
getSpecialCharacters()
boolean
isAllowTruncation()
boolean
isMustBeginWithLetter()
boolean
isNullable()
boolean
isOnlyLettersDigitsUnderscores()
boolean
isReservedWord(java.lang.String identifier)
boolean
requiresDelimiters(java.lang.String identifier)
SQL identifier rules: 1) Can be up to 128 characters long 2) Must begin with a letter 3) Can contain letters, digits, and underscores 4) Can't contain spaces or special characters such as #, $, &, %, or punctuation. 5) Can't be reserved wordsvoid
setAllowCompaction(boolean allowCompaction)
void
setAllowTruncation(boolean allowTruncation)
void
setCanDelimit(boolean canDelimit)
void
setDelimitReservedWords(boolean delimitReservedWords)
void
setMaxLength(int maxLength)
void
setMustBeginWithLetter(boolean mustBeginWithLetter)
void
setMustDelimit(boolean mustDelimit)
void
setName(java.lang.String name)
void
setNullable(boolean nullable)
void
setOnlyLettersDigitsUnderscores(boolean onlyLettersDigitsUnderscores)
void
setReservedWords(java.util.Set<java.lang.String> reservedWords)
void
setSpecialCharacters(java.lang.String specialCharacters)
-
-
-
Field Detail
-
EMPTY_SET
public static final java.util.Set<java.lang.String> EMPTY_SET
-
DEFAULT_RULE
public static final java.lang.String DEFAULT_RULE
- See Also:
- Constant Field Values
-
UNDERSCORE
public static char UNDERSCORE
-
-
Method Detail
-
setName
public void setName(java.lang.String name)
-
getName
public java.lang.String getName()
-
setMaxLength
public void setMaxLength(int maxLength)
-
getMaxLength
public int getMaxLength()
-
setAllowTruncation
public void setAllowTruncation(boolean allowTruncation)
-
isAllowTruncation
public boolean isAllowTruncation()
-
setNullable
public void setNullable(boolean nullable)
-
isNullable
public boolean isNullable()
-
setAllowCompaction
public void setAllowCompaction(boolean allowCompaction)
-
getAllowCompaction
public boolean getAllowCompaction()
-
setCanDelimit
public void setCanDelimit(boolean canDelimit)
-
getCanDelimit
public boolean getCanDelimit()
-
setMustDelimit
public void setMustDelimit(boolean mustDelimit)
-
getMustDelimit
public boolean getMustDelimit()
-
setMustBeginWithLetter
public void setMustBeginWithLetter(boolean mustBeginWithLetter)
-
isMustBeginWithLetter
public boolean isMustBeginWithLetter()
-
setOnlyLettersDigitsUnderscores
public void setOnlyLettersDigitsUnderscores(boolean onlyLettersDigitsUnderscores)
-
isOnlyLettersDigitsUnderscores
public boolean isOnlyLettersDigitsUnderscores()
-
setReservedWords
public void setReservedWords(java.util.Set<java.lang.String> reservedWords)
-
getReservedWords
public java.util.Set<java.lang.String> getReservedWords()
-
setSpecialCharacters
public void setSpecialCharacters(java.lang.String specialCharacters)
-
getSpecialCharacters
public java.lang.String getSpecialCharacters()
-
setDelimitReservedWords
public void setDelimitReservedWords(boolean delimitReservedWords)
-
getDelimitReservedWords
public boolean getDelimitReservedWords()
-
requiresDelimiters
public boolean requiresDelimiters(java.lang.String identifier)
SQL identifier rules: 1) Can be up to 128 characters long 2) Must begin with a letter 3) Can contain letters, digits, and underscores 4) Can't contain spaces or special characters such as #, $, &, %, or punctuation. 5) Can't be reserved words
-
isReservedWord
public boolean isReservedWord(java.lang.String identifier)
-
-