java.lang.Object
org.firebirdsql.jdbc.metadata.MetadataPattern
Holder of a database metadata pattern.
Provides information whether the pattern is the all-pattern, or if the condition needs a normal equality comparison,
a SQL LIKE, or a SQL STARTING WITH.
- Since:
- 4.0
- Author:
- Mark Rotteveel
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic MetadataPatternCompiles the metadata pattern.static booleancontainsPatternSpecialChars(String pattern) Scans string to determine if string contains any of\_%that indicates additional processing is needed.static StringescapeWildcards(String objectName) Escapes the like wildcards and escape (\_%in the provided search string with a\.static booleanisAllCondition(String metadataPattern) static booleanisPatternSpecialChar(char charVal) Checks if character is a database metadata pattern special.renderCondition(String columnName) Renders the condition for this pattern.
-
Method Details
-
getConditionType
- Returns:
- Type of condition to use for this metadata pattern
-
getConditionValue
- Returns:
- Value for the condition;
nullsignals no value
-
renderCondition
Renders the condition for this pattern.- Parameters:
columnName- column name- Returns:
- Rendered condition (can be empty string if there is no condition).
-
toMetadataPatternMatcher
- Returns:
- Metadata pattern matcher for this metadata pattern
-
compile
Compiles the metadata pattern.- Parameters:
metadataPattern- Metadata pattern string- Returns:
- MetadataPattern instance
-
containsPatternSpecialChars
Scans string to determine if string contains any of\_%that indicates additional processing is needed.- Parameters:
pattern- metadata pattern- Returns:
trueif the string contains any like special characters
-
isPatternSpecialChar
public static boolean isPatternSpecialChar(char charVal) Checks if character is a database metadata pattern special.- Parameters:
charVal- Character to check- Returns:
trueifcharValis a pattern special (\_%)
-
escapeWildcards
Escapes the like wildcards and escape (\_%in the provided search string with a\.- Parameters:
objectName- Object name to escape.- Returns:
- Object name with wildcards escaped.
-
isAllCondition
-