类 AbstractAnsiTrimEmulationFunction
- java.lang.Object
-
- org.hibernate.dialect.function.AbstractAnsiTrimEmulationFunction
-
- 所有已实现的接口:
SQLFunction
- 直接已知子类:
AnsiTrimEmulationFunction
public abstract class AbstractAnsiTrimEmulationFunction extends Object implements SQLFunction
ASQLFunctionproviding support for implementing TRIM functionality (as defined by both the ANSI SQL and JPA specs) in cases where the dialect may not support the full trim function itself. Follows the template pattern in order to implement therender(org.hibernate.type.Type, java.util.List, org.hibernate.engine.spi.SessionFactoryImplementor)method.- 作者:
- Steve Ebersole
-
-
构造器概要
构造器 构造器 说明 AbstractAnsiTrimEmulationFunction()
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 TypegetReturnType(Type argumentType, Mapping mapping)The return type of the function.booleanhasArguments()Does this function have any arguments?booleanhasParenthesesIfNoArguments()If there are no arguments, are parentheses required?Stringrender(Type argumentType, List args, SessionFactoryImplementor factory)Render the function call as SQL fragment.protected abstract SQLFunctionresolveBothSpaceTrimFromFunction()Resolve the function definition which should be used to trim both leading and trailing spaces.protected abstract SQLFunctionresolveBothSpaceTrimFunction()Resolve the function definition which should be used to trim both leading and trailing spaces.protected abstract 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 abstract SQLFunctionresolveLeadingSpaceTrimFunction()Resolve the function definition which should be used to trim leading spaces.protected abstract SQLFunctionresolveLeadingTrimFunction()Resolve the function definition which should be used to trim the specified character from the beginning (leading) of the trim source.protected abstract SQLFunctionresolveTrailingSpaceTrimFunction()Resolve the function definition which should be used to trim trailing spaces.protected abstract SQLFunctionresolveTrailingTrimFunction()Resolve the function definition which should be used to trim the specified character from the end (trailing) of the trim source.
-
-
-
方法详细资料
-
hasArguments
public final boolean hasArguments()
从接口复制的说明:SQLFunctionDoes this function have any arguments?- 指定者:
hasArguments在接口中SQLFunction- 返回:
- True if the function expects to have parameters; false otherwise.
-
hasParenthesesIfNoArguments
public final boolean hasParenthesesIfNoArguments()
从接口复制的说明:SQLFunctionIf there are no arguments, are parentheses required?- 指定者:
hasParenthesesIfNoArguments在接口中SQLFunction- 返回:
- True if a no-arg call of this function requires parentheses.
-
getReturnType
public final Type getReturnType(Type argumentType, Mapping mapping) throws QueryException
从接口复制的说明:SQLFunctionThe return type of the function. May be either a concrete type which is preset, or variable depending upon the type of the first function argument. Note, the 'firstArgumentType' parameter should match the one passed intoSQLFunction.render(org.hibernate.type.Type, java.util.List, org.hibernate.engine.spi.SessionFactoryImplementor)- 指定者:
getReturnType在接口中SQLFunction- 参数:
argumentType- The type of the first argumentmapping- The mapping source.- 返回:
- The type to be expected as a return.
- 抛出:
QueryException- Indicates an issue resolving the return type.
-
render
public final String render(Type argumentType, List args, SessionFactoryImplementor factory) throws QueryException
从接口复制的说明:SQLFunctionRender the function call as SQL fragment. Note, the 'firstArgumentType' parameter should match the one passed intoSQLFunction.getReturnType(org.hibernate.type.Type, org.hibernate.engine.spi.Mapping)- 指定者:
render在接口中SQLFunction- 参数:
argumentType- The type of the first argumentargs- The function argumentsfactory- The SessionFactory- 返回:
- The rendered function call
- 抛出:
QueryException- Indicates a problem rendering the function call.
-
resolveBothSpaceTrimFunction
protected abstract 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.- 返回:
- The sql function
-
resolveBothSpaceTrimFromFunction
protected abstract 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.- 返回:
- The sql function
-
resolveLeadingSpaceTrimFunction
protected abstract SQLFunction resolveLeadingSpaceTrimFunction()
Resolve the function definition which should be used to trim leading spaces.- 返回:
- The sql function
-
resolveTrailingSpaceTrimFunction
protected abstract SQLFunction resolveTrailingSpaceTrimFunction()
Resolve the function definition which should be used to trim trailing spaces.- 返回:
- The sql function
-
resolveBothTrimFunction
protected abstract 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.- 返回:
- The sql function
-
resolveLeadingTrimFunction
protected abstract SQLFunction resolveLeadingTrimFunction()
Resolve the function definition which should be used to trim the specified character from the beginning (leading) of the trim source.- 返回:
- The sql function
-
resolveTrailingTrimFunction
protected abstract SQLFunction resolveTrailingTrimFunction()
Resolve the function definition which should be used to trim the specified character from the end (trailing) of the trim source.- 返回:
- The sql function
-
-