Module org.seasar.doma.core
Package org.seasar.doma.jdbc.dialect
Class StandardDialect.StandardExpressionFunctions
java.lang.Object
org.seasar.doma.jdbc.dialect.StandardDialect.StandardExpressionFunctions
- All Implemented Interfaces:
ExpressionFunctions
- Direct Known Subclasses:
Db2Dialect.Db2ExpressionFunctions,H212126Dialect.H212126ExpressionFunctions,HsqldbDialect.HsqldbExpressionFunctions,Mssql2008Dialect.Mssql2008ExpressionFunctions,MysqlDialect.MysqlExpressionFunctions,Oracle11Dialect.Oracle11ExpressionFunctions,PostgresDialect.PostgresExpressionFunctions,SqliteDialect.SqliteExpressionFunctions
- Enclosing class:
- StandardDialect
public static class StandardDialect.StandardExpressionFunctions
extends Object
implements ExpressionFunctions
A standard implementation of
ExpressionFunctions.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringthe default replacement string for wild card charactersprotected final Patternthe default pattern for escape wild card charactersprotected final charthe escape character for the SQL LIKE operatorprotected final char[]the wild card characters for the SQL LIKE operator -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedStandardExpressionFunctions(char[] wildcards) protectedStandardExpressionFunctions(char escapeChar, char[] wildcards) protectedStandardExpressionFunctions(char escapeChar, char[] wildcards, Pattern defaultWildcardReplacementPattern, String defaultReplacement) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcreateWildcardReplacement(char escapeChar) Create the replacement string that replaces wild card characters.protected PatterncreateWildcardReplacementPattern(char escapeChar, char[] wildcards) Creates the regular expression pattern that is represents the wild card characters .escape(CharSequence text) Escapes the SQL LIKE wild card characters in a target string by using the default escape character.escape(CharSequence text, char escapeChar) Escapes the SQL LIKE wild card characters in a target string by using a specified escape character.protected StringescapeWildcard(CharSequence input, char escapeChar) Escapes wild card characters.protected StringescapeWildcard(Pattern pattern, CharSequence input, String replacement) Escapes wild card characters with the regular expression.infix(CharSequence text) Escapes the SQL LIKE wild card characters in a target string by using the default escape character '$' and generate a text to perform a infix search for the SQL LIKE operator.infix(CharSequence text, char escapeChar) Escapes the SQL LIKE wild card characters in a target string by using a specified escape character and generate a text to perform a infix search for the SQL LIKE operator.booleanisBlank(CharSequence charSequence) Whether a text is blank.booleanisEmpty(CharSequence charSequence) Whether a text is empty.booleanisNotBlank(CharSequence charSequence) Whether a text is not blank.booleanisNotEmpty(CharSequence charSequence) Whether a text is not empty.protected CalendarmakeRoundedDownCalendar(Date date) protected CalendarmakeRoundedUpCalendar(Date date) prefix(CharSequence text) Escapes the SQL LIKE wild card characters in a target string by using the default escape character '$' and generate a text to perform a prefix search for the SQL Like operator.prefix(CharSequence text, char escapeChar) Escapes the SQL LIKE wild card characters in a target string by using a specified escape character and generate a text to perform a prefix search for the SQL LIKE operator.roundDownTimePart(Date date) Round down a time part ofDate.roundDownTimePart(Timestamp timestamp) Round down a time part ofTimestamp.roundDownTimePart(LocalDateTime localDateTime) Round down a time part ofLocalDateTime.roundDownTimePart(Date date) Round down a time part ofDate.roundUpTimePart(Date date) Round up a time part ofDate.roundUpTimePart(Timestamp timestamp) Round up a time part ofTimestamp.roundUpTimePart(LocalDate localDate) Return the next day.roundUpTimePart(LocalDateTime localDateTime) Round up a time part ofLocalDateTime.roundUpTimePart(Date date) Round up a time part ofDate.suffix(CharSequence text) Escapes the SQL LIKE wild card characters in a target string by using the default escape character '$' and generate a text to perform a suffix search for the SQL LIKE operator.suffix(CharSequence text, char escapeChar) Escapes the SQL LIKE wild card characters in a target string by using a specified escape character and generate a text to perform a suffix search for the SQL LIKE operator.
-
Field Details
-
escapeChar
protected final char escapeCharthe escape character for the SQL LIKE operator -
wildcards
protected final char[] wildcardsthe wild card characters for the SQL LIKE operator -
defaultWildcardReplacementPattern
the default pattern for escape wild card characters -
defaultReplacement
the default replacement string for wild card characters
-
-
Constructor Details
-
StandardExpressionFunctions
protected StandardExpressionFunctions() -
StandardExpressionFunctions
protected StandardExpressionFunctions(char[] wildcards) - Parameters:
wildcards- the wild card characters for the SQL LIKE operator
-
StandardExpressionFunctions
protected StandardExpressionFunctions(char escapeChar, char[] wildcards) - Parameters:
escapeChar- the escape character for the SQL LIKE operatorwildcards- the wild card characters for the SQL LIKE operator
-
StandardExpressionFunctions
protected StandardExpressionFunctions(char escapeChar, char[] wildcards, Pattern defaultWildcardReplacementPattern, String defaultReplacement) - Parameters:
escapeChar- the escape character for the SQL LIKE operatorwildcards- the wild card characters for the SQL LIKE operatordefaultWildcardReplacementPattern- the default pattern for escape wild card charactersdefaultReplacement- the default replacement string for wild card characters
-
-
Method Details
-
escape
Description copied from interface:ExpressionFunctionsEscapes the SQL LIKE wild card characters in a target string by using a specified escape character.- Specified by:
escapein interfaceExpressionFunctions- Parameters:
text- the target textescapeChar- the escape character- Returns:
- the escaped text
-
escape
Description copied from interface:ExpressionFunctionsEscapes the SQL LIKE wild card characters in a target string by using the default escape character.For example,
a%b_is converted to the aa$%b$_.- Specified by:
escapein interfaceExpressionFunctions- Parameters:
text- the target text- Returns:
- the escaped text
-
prefix
Description copied from interface:ExpressionFunctionsEscapes the SQL LIKE wild card characters in a target string by using the default escape character '$' and generate a text to perform a prefix search for the SQL Like operator.For example,
a%b_is converted to the aa$%b$_%.- Specified by:
prefixin interfaceExpressionFunctions- Parameters:
text- the prefix text- Returns:
- the text for a prefix search
-
prefix
Description copied from interface:ExpressionFunctionsEscapes the SQL LIKE wild card characters in a target string by using a specified escape character and generate a text to perform a prefix search for the SQL LIKE operator.- Specified by:
prefixin interfaceExpressionFunctions- Parameters:
text- the prefixed textescapeChar- the escape character- Returns:
- the text for a prefix search
-
suffix
Description copied from interface:ExpressionFunctionsEscapes the SQL LIKE wild card characters in a target string by using the default escape character '$' and generate a text to perform a suffix search for the SQL LIKE operator.For example,
a%b_is converted to the a%a$%b$_.- Specified by:
suffixin interfaceExpressionFunctions- Parameters:
text- the suffix text- Returns:
- the text for a suffix search
-
suffix
Description copied from interface:ExpressionFunctionsEscapes the SQL LIKE wild card characters in a target string by using a specified escape character and generate a text to perform a suffix search for the SQL LIKE operator.- Specified by:
suffixin interfaceExpressionFunctions- Parameters:
text- the suffix textescapeChar- the escape character- Returns:
- the text for a suffix search
-
infix
Description copied from interface:ExpressionFunctionsEscapes the SQL LIKE wild card characters in a target string by using the default escape character '$' and generate a text to perform a infix search for the SQL LIKE operator.For example,
a%b_is converted to the a%a$%b$_%.- Specified by:
infixin interfaceExpressionFunctions- Parameters:
text- the infix text- Returns:
- the text for a infix search
-
infix
Description copied from interface:ExpressionFunctionsEscapes the SQL LIKE wild card characters in a target string by using a specified escape character and generate a text to perform a infix search for the SQL LIKE operator.- Specified by:
infixin interfaceExpressionFunctions- Parameters:
text- the infix textescapeChar- the escape character- Returns:
- the text for a infix search
-
escapeWildcard
Escapes wild card characters.- Parameters:
input- the target string for escapingescapeChar- the escape character- Returns:
- the escaped string
-
escapeWildcard
Escapes wild card characters with the regular expression.- Parameters:
pattern- the regular expression patterninput- the target string for escapingreplacement- the replacement string- Returns:
- the escaped string
-
roundDownTimePart
Description copied from interface:ExpressionFunctionsRound down a time part ofDate.- Specified by:
roundDownTimePartin interfaceExpressionFunctions- Parameters:
date- the target date- Returns:
- the date whose time part is rounded down
-
roundDownTimePart
Description copied from interface:ExpressionFunctionsRound down a time part ofDate.- Specified by:
roundDownTimePartin interfaceExpressionFunctions- Parameters:
date- the target date- Returns:
- the date whose time part is rounded down
-
roundDownTimePart
Description copied from interface:ExpressionFunctionsRound down a time part ofTimestamp.- Specified by:
roundDownTimePartin interfaceExpressionFunctions- Parameters:
timestamp- the target timestamp- Returns:
- the timestamp whose time part is rounded down
-
roundDownTimePart
Description copied from interface:ExpressionFunctionsRound down a time part ofLocalDateTime.- Specified by:
roundDownTimePartin interfaceExpressionFunctions- Parameters:
localDateTime- the target localDateTime- Returns:
- the localDateTime whose time part is rounded down
-
makeRoundedDownCalendar
-
roundUpTimePart
Description copied from interface:ExpressionFunctionsRound up a time part ofDate.- Specified by:
roundUpTimePartin interfaceExpressionFunctions- Parameters:
date- the target date- Returns:
- the date whose time part is rounded up
-
roundUpTimePart
Description copied from interface:ExpressionFunctionsRound up a time part ofDate.- Specified by:
roundUpTimePartin interfaceExpressionFunctions- Parameters:
date- the target date- Returns:
- the date whose time part is rounded up
-
roundUpTimePart
Description copied from interface:ExpressionFunctionsRound up a time part ofTimestamp.- Specified by:
roundUpTimePartin interfaceExpressionFunctions- Parameters:
timestamp- the target timestamp- Returns:
- the timestamp whose time part is rounded up
-
roundUpTimePart
Description copied from interface:ExpressionFunctionsReturn the next day.- Specified by:
roundUpTimePartin interfaceExpressionFunctions- Parameters:
localDate- the target localDate- Returns:
- the next day
-
roundUpTimePart
Description copied from interface:ExpressionFunctionsRound up a time part ofLocalDateTime.- Specified by:
roundUpTimePartin interfaceExpressionFunctions- Parameters:
localDateTime- the target localDateTime- Returns:
- the localDateTime whose time part is rounded up
-
makeRoundedUpCalendar
-
createWildcardReplacementPattern
Creates the regular expression pattern that is represents the wild card characters .- Parameters:
escapeChar- the escape characterwildcards- the wild card character- Returns:
- the pattern
-
createWildcardReplacement
Create the replacement string that replaces wild card characters.- Parameters:
escapeChar- the escape character- Returns:
- the replacement string
-
isEmpty
Description copied from interface:ExpressionFunctionsWhether a text is empty.- Specified by:
isEmptyin interfaceExpressionFunctions- Parameters:
charSequence- the target text- Returns:
trueif the text isnullor its length is0, elsefalse
-
isNotEmpty
Description copied from interface:ExpressionFunctionsWhether a text is not empty.- Specified by:
isNotEmptyin interfaceExpressionFunctions- Parameters:
charSequence- the target text- Returns:
falseif the text isnullor its length is0, elsetrue
-
isBlank
Description copied from interface:ExpressionFunctionsWhether a text is blank.- Specified by:
isBlankin interfaceExpressionFunctions- Parameters:
charSequence- the target text- Returns:
trueif the text isnull, its length is0or the text contains only blank characters, elsefalse.
-
isNotBlank
Description copied from interface:ExpressionFunctionsWhether a text is not blank.- Specified by:
isNotBlankin interfaceExpressionFunctions- Parameters:
charSequence- the target text- Returns:
falseif the text isnull, its length is0or the text contains only blank characters, elsetrue.
-