类 AnsiTrimEmulationFunction
- java.lang.Object
-
- org.hibernate.dialect.function.AbstractAnsiTrimEmulationFunction
-
- org.hibernate.dialect.function.AnsiTrimEmulationFunction
-
- 所有已实现的接口:
SQLFunction
public class AnsiTrimEmulationFunction extends AbstractAnsiTrimEmulationFunction
ASQLFunctionimplementation that emulates the ANSI SQL trim function on dialects which do not support the full definition. However, this function definition does assume the availability of ltrim, rtrim, and replace functions which it uses in various combinations to emulate the desired ANSI trim() functionality.- 作者:
- Steve Ebersole
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringBOTH_SPACE_TRIM_FROM_TEMPLATEThe SQLFunctionTemplate pattern for the trimming both leading and trailing spaces, with the optional FROM keyword.static StringBOTH_SPACE_TRIM_TEMPLATEThe SQLFunctionTemplate pattern for the trimming both leading and trailing spacesstatic StringBOTH_TRIM_TEMPLATEA template for the series of calls required to trim non-space chars from both the beginning and the end of text.static StringLEADING_SPACE_TRIM_TEMPLATEThe SQLFunctionTemplate pattern for the trimming leading spacesstatic StringLEADING_TRIM_TEMPLATEA template for the series of calls required to trim non-space chars from the beginning of text.static StringLTRIMThe defaultltrimfunction namestatic StringREPLACEThe defaultreplacefunction namestatic StringRTRIMThe defaultrtrimfunction namestatic StringSPACE_PLACEHOLDERThe placeholder used to represent whitespacestatic StringTRAILING_SPACE_TRIM_TEMPLATEThe SQLFunctionTemplate pattern for the trimming trailing spacesstatic StringTRAILING_TRIM_TEMPLATEA template for the series of calls required to trim non-space chars from the end of text.
-
构造器概要
构造器 构造器 说明 AnsiTrimEmulationFunction()AnsiTrimEmulationFunction(String ltrimFunctionName, String rtrimFunctionName, String replaceFunctionName)Constructs a trim() emulation function definition using the specified function calls.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected SQLFunctionresolveBothSpaceTrimFromFunction()Resolve the function definition which should be used to trim both leading and trailing spaces.protected SQLFunctionresolveBothSpaceTrimFunction()Resolve the function definition which should be used to trim both leading and trailing spaces.protected SQLFunctionresolveBothTrimFunction()Resolve the function definition which should be used to trim the specified character from both the beginning (leading) and end (trailing) of the trim source.protected SQLFunctionresolveLeadingSpaceTrimFunction()Resolve the function definition which should be used to trim leading spaces.protected SQLFunctionresolveLeadingTrimFunction()Resolve the function definition which should be used to trim the specified character from the beginning (leading) of the trim source.protected SQLFunctionresolveTrailingSpaceTrimFunction()Resolve the function definition which should be used to trim trailing spaces.protected SQLFunctionresolveTrailingTrimFunction()Resolve the function definition which should be used to trim the specified character from the end (trailing) of the trim source.-
从类继承的方法 org.hibernate.dialect.function.AbstractAnsiTrimEmulationFunction
getReturnType, hasArguments, hasParenthesesIfNoArguments, render
-
-
-
-
字段详细资料
-
SPACE_PLACEHOLDER
public static final String SPACE_PLACEHOLDER
The placeholder used to represent whitespace- 另请参阅:
- 常量字段值
-
LEADING_SPACE_TRIM_TEMPLATE
public static final String LEADING_SPACE_TRIM_TEMPLATE
The SQLFunctionTemplate pattern for the trimming leading spaces- 另请参阅:
- 常量字段值
-
TRAILING_SPACE_TRIM_TEMPLATE
public static final String TRAILING_SPACE_TRIM_TEMPLATE
The SQLFunctionTemplate pattern for the trimming trailing spaces- 另请参阅:
- 常量字段值
-
BOTH_SPACE_TRIM_TEMPLATE
public static final String BOTH_SPACE_TRIM_TEMPLATE
The SQLFunctionTemplate pattern for the trimming both leading and trailing spaces- 另请参阅:
- 常量字段值
-
BOTH_SPACE_TRIM_FROM_TEMPLATE
public static final String BOTH_SPACE_TRIM_FROM_TEMPLATE
The SQLFunctionTemplate pattern for the trimming both leading and trailing spaces, with the optional FROM keyword. Different because we need to skip the FROM keyword in the SQLFunctionTemplate processing- 另请参阅:
- 常量字段值
-
LEADING_TRIM_TEMPLATE
public static final String LEADING_TRIM_TEMPLATE
A template for the series of calls required to trim non-space chars from the beginning of text. NOTE : essentially we:- replace all space chars with the text '${space}$'
- replace all the actual replacement chars with space chars
- perform left-trimming (that removes any of the space chars we just added which occur at the beginning of the text)
- replace all space chars with the replacement char
- replace all the '${space}$' text with space chars
- 另请参阅:
- 常量字段值
-
TRAILING_TRIM_TEMPLATE
public static final String TRAILING_TRIM_TEMPLATE
A template for the series of calls required to trim non-space chars from the end of text. NOTE: essentially the same series of calls as outlined inLEADING_TRIM_TEMPLATEexcept that here, instead of left-trimming the added spaces, we right-trim them to remove them from the end of the text.- 另请参阅:
- 常量字段值
-
BOTH_TRIM_TEMPLATE
public static final String BOTH_TRIM_TEMPLATE
A template for the series of calls required to trim non-space chars from both the beginning and the end of text. NOTE: again, we have a series of calls that is essentially the same as outlined inLEADING_TRIM_TEMPLATEexcept that here we perform both left (leading) and right (trailing) trimming.- 另请参阅:
- 常量字段值
-
-
构造器详细资料
-
AnsiTrimEmulationFunction
public AnsiTrimEmulationFunction()
-
AnsiTrimEmulationFunction
public AnsiTrimEmulationFunction(String ltrimFunctionName, String rtrimFunctionName, String replaceFunctionName)
Constructs a trim() emulation function definition using the specified function calls.- 参数:
ltrimFunctionName- The left trim function to use.rtrimFunctionName- The right trim function to use.replaceFunctionName- The replace function to use.
-
-
方法详细资料
-
resolveBothSpaceTrimFunction
protected SQLFunction resolveBothSpaceTrimFunction()
Resolve the function definition which should be used to trim both leading and trailing spaces. In this form, the input arguments is missing the FROM keyword.- 指定者:
resolveBothSpaceTrimFunction在类中AbstractAnsiTrimEmulationFunction- 返回:
- The sql function
-
resolveBothSpaceTrimFromFunction
protected SQLFunction resolveBothSpaceTrimFromFunction()
Resolve the function definition which should be used to trim both leading and trailing spaces. The same as {#link resolveBothSpaceTrimFunction} except that here theFROM is included and will need to be accounted for duringSQLFunction.render(org.hibernate.type.Type, java.util.List, org.hibernate.engine.spi.SessionFactoryImplementor)processing.- 指定者:
resolveBothSpaceTrimFromFunction在类中AbstractAnsiTrimEmulationFunction- 返回:
- The sql function
-
resolveLeadingSpaceTrimFunction
protected SQLFunction resolveLeadingSpaceTrimFunction()
Resolve the function definition which should be used to trim leading spaces.- 指定者:
resolveLeadingSpaceTrimFunction在类中AbstractAnsiTrimEmulationFunction- 返回:
- The sql function
-
resolveTrailingSpaceTrimFunction
protected SQLFunction resolveTrailingSpaceTrimFunction()
Resolve the function definition which should be used to trim trailing spaces.- 指定者:
resolveTrailingSpaceTrimFunction在类中AbstractAnsiTrimEmulationFunction- 返回:
- The sql function
-
resolveBothTrimFunction
protected SQLFunction resolveBothTrimFunction()
Resolve the function definition which should be used to trim the specified character from both the beginning (leading) and end (trailing) of the trim source.- 指定者:
resolveBothTrimFunction在类中AbstractAnsiTrimEmulationFunction- 返回:
- The sql function
-
resolveLeadingTrimFunction
protected SQLFunction resolveLeadingTrimFunction()
Resolve the function definition which should be used to trim the specified character from the beginning (leading) of the trim source.- 指定者:
resolveLeadingTrimFunction在类中AbstractAnsiTrimEmulationFunction- 返回:
- The sql function
-
resolveTrailingTrimFunction
protected SQLFunction resolveTrailingTrimFunction()
Resolve the function definition which should be used to trim the specified character from the end (trailing) of the trim source.- 指定者:
resolveTrailingTrimFunction在类中AbstractAnsiTrimEmulationFunction- 返回:
- The sql function
-
-