public abstract class

AbstractAnsiTrimEmulationFunction

extends Object
implements SQLFunction
java.lang.Object
   ↳ org.hibernate.dialect.function.AbstractAnsiTrimEmulationFunction
Known Direct Subclasses

Class Overview

A 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(Type, List, SessionFactoryImplementor) method.

Summary

Public Constructors
AbstractAnsiTrimEmulationFunction()
Public Methods
final Type getReturnType(Type argumentType, Mapping mapping)
The return type of the function.
final boolean hasArguments()
Does this function have any arguments?
final boolean hasParenthesesIfNoArguments()
If there are no arguments, are parentheses required?
final String render(Type argumentType, List args, SessionFactoryImplementor factory)
Render the function call as SQL fragment.
Protected Methods
abstract SQLFunction resolveBothSpaceTrimFromFunction()
Resolve the function definition which should be used to trim both leading and trailing spaces.
abstract SQLFunction resolveBothSpaceTrimFunction()
Resolve the function definition which should be used to trim both leading and trailing spaces.
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.
abstract SQLFunction resolveLeadingSpaceTrimFunction()
Resolve the function definition which should be used to trim leading spaces.
abstract SQLFunction resolveLeadingTrimFunction()
Resolve the function definition which should be used to trim the specified character from the beginning (leading) of the trim source.
abstract SQLFunction resolveTrailingSpaceTrimFunction()
Resolve the function definition which should be used to trim trailing spaces.
abstract SQLFunction resolveTrailingTrimFunction()
Resolve the function definition which should be used to trim the specified character from the end (trailing) of the trim source.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.hibernate.dialect.function.SQLFunction

Public Constructors

public AbstractAnsiTrimEmulationFunction ()

Public Methods

public final Type getReturnType (Type argumentType, Mapping mapping)

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(Type, List, SessionFactoryImplementor)

Parameters
argumentType The type of the first argument
mapping The mapping source.
Returns
  • The type to be expected as a return.

public final boolean hasArguments ()

Does this function have any arguments?

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

public final boolean hasParenthesesIfNoArguments ()

If there are no arguments, are parentheses required?

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

public final String render (Type argumentType, List args, SessionFactoryImplementor factory)

Render the function call as SQL fragment.

Note, the 'firstArgumentType' parameter should match the one passed into getReturnType(Type, Mapping)

Parameters
argumentType The type of the first argument
args The function arguments
factory The SessionFactory
Returns
  • The rendered function call

Protected Methods

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 render(Type, List, SessionFactoryImplementor) processing.

Returns
  • The sql function

protected abstract SQLFunction resolveBothSpaceTrimFunction ()

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

In this form, the imput arguments is missing the FROM keyword.

Returns
  • The sql function

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

protected abstract SQLFunction resolveLeadingSpaceTrimFunction ()

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

Returns
  • The sql function

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

protected abstract SQLFunction resolveTrailingSpaceTrimFunction ()

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

Returns
  • The sql function

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