Top Description Constructors Methods
org.hibernate.dialect.function

public abstract Class AbstractAnsiTrimEmulationFunction

extends Object
implements SQLFunction
Class Inheritance
All Implemented Interfaces
org.hibernate.dialect.function.SQLFunction
Known Direct Subclasses
org.hibernate.dialect.function.AnsiTrimEmulationFunction
Imports
java.util.ArrayList, .List, org.hibernate.QueryException, org.hibernate.engine.spi.Mapping, .SessionFactoryImplementor, org.hibernate.type.StandardBasicTypes, .Type

A org.hibernate.dialect.function.SQLFunction providing 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 the render method.

Author
Steve Ebersole

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final Type
getReturnType(Type
The type of the first argument
argumentType
,
Mapping
The mapping source.
mapping
)

Implements org.hibernate.dialect.function.SQLFunction.getReturnType.

The return type of the function.
public final boolean
hasArguments()

Implements org.hibernate.dialect.function.SQLFunction.hasArguments.

Does this function have any arguments?
public final boolean
hasParenthesesIfNoArguments()

Implements org.hibernate.dialect.function.SQLFunction.hasParenthesesIfNoArguments.

If there are no arguments, are parentheses required?
public final String
render(Type
The type of the first argument
argumentType
,
List<E>
The function arguments
args
,
SessionFactoryImplementor
The SessionFactory
factory
)

Implements org.hibernate.dialect.function.SQLFunction.render.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Render the function call as SQL fragment.
protected abstract SQLFunction

Returns:

The sql function
resolveBothSpaceTrimFromFunction
()

Resolve the function definition which should be used to trim both leading and trailing spaces.

protected abstract SQLFunction

Returns:

The sql function
resolveBothSpaceTrimFunction
()

Resolve the function definition which should be used to trim both leading and trailing spaces.

protected abstract SQLFunction

Returns:

The sql function
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.

protected abstract SQLFunction

Returns:

The sql function
resolveLeadingSpaceTrimFunction
()

Resolve the function definition which should be used to trim leading spaces.

protected abstract SQLFunction

Returns:

The sql function
resolveLeadingTrimFunction
()

Resolve the function definition which should be used to trim the specified character from the beginning (leading) of the trim source.

protected abstract SQLFunction

Returns:

The sql function
resolveTrailingSpaceTrimFunction
()

Resolve the function definition which should be used to trim trailing spaces.

protected abstract SQLFunction

Returns:

The sql function
resolveTrailingTrimFunction
()

Resolve the function definition which should be used to trim the specified character from the end (trailing) of the trim source.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AbstractAnsiTrimEmulationFunctionback to summary
public AbstractAnsiTrimEmulationFunction()

Method Detail

getReturnTypeback to summary
public final Type getReturnType(Type argumentType, Mapping mapping) throws QueryException

Implements org.hibernate.dialect.function.SQLFunction.getReturnType.

Doc from org.hibernate.dialect.function.SQLFunction.getReturnType.

The 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 into render

Parameters
argumentType:Type

The type of the first argument

mapping:Mapping

The mapping source.

Returns:Type

The type to be expected as a return.

Annotations
@Override
Exceptions
QueryException:
Indicates an issue resolving the return type.
hasArgumentsback to summary
public final boolean hasArguments()

Implements org.hibernate.dialect.function.SQLFunction.hasArguments.

Doc from org.hibernate.dialect.function.SQLFunction.hasArguments.

Does this function have any arguments?

Returns:boolean

True if the function expects to have parameters; false otherwise.

Annotations
@Override
hasParenthesesIfNoArgumentsback to summary
public final boolean hasParenthesesIfNoArguments()

Implements org.hibernate.dialect.function.SQLFunction.hasParenthesesIfNoArguments.

Doc from org.hibernate.dialect.function.SQLFunction.hasParenthesesIfNoArguments.

If there are no arguments, are parentheses required?

Returns:boolean

True if a no-arg call of this function requires parentheses.

Annotations
@Override
renderback to summary
public final String render(Type argumentType, List<E> args, SessionFactoryImplementor factory) throws QueryException

Implements org.hibernate.dialect.function.SQLFunction.render.

Doc from org.hibernate.dialect.function.SQLFunction.render.

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Render the function call as SQL fragment.

Note, the 'firstArgumentType' parameter should match the one passed into getReturnType

Parameters
argumentType:Type

The type of the first argument

args:List<E>

The function arguments

factory:SessionFactoryImplementor

The SessionFactory

Returns:String

The rendered function call

Annotations
@Override
Exceptions
QueryException:
Indicates a problem rendering the function call.
resolveBothSpaceTrimFromFunctionback to summary
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 during SQLFunction#render processing.

Returns:SQLFunction

The sql function

resolveBothSpaceTrimFunctionback to summary
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.

Returns:SQLFunction

The sql function

resolveBothTrimFunctionback to summary
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.

Returns:SQLFunction

The sql function

resolveLeadingSpaceTrimFunctionback to summary
protected abstract SQLFunction resolveLeadingSpaceTrimFunction()

Resolve the function definition which should be used to trim leading spaces.

Returns:SQLFunction

The sql function

resolveLeadingTrimFunctionback to summary
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.

Returns:SQLFunction

The sql function

resolveTrailingSpaceTrimFunctionback to summary
protected abstract SQLFunction resolveTrailingSpaceTrimFunction()

Resolve the function definition which should be used to trim trailing spaces.

Returns:SQLFunction

The sql function

resolveTrailingTrimFunctionback to summary
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.

Returns:SQLFunction

The sql function