Top Description Inners Constructors Methods
org.hibernate.dialect.function

public abstract Class TrimFunctionTemplate

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

Defines the basic template support for TRIM functions
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
protected static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

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

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

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

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

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

If there are no arguments, are parentheses required?
public String
render(Type
The type of the first argument
firstArgument
,
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 String
render(TrimFunctionTemplate.Options options, String trimSource, SessionFactoryImplementor factory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

TrimFunctionTemplateback to summary
public TrimFunctionTemplate()

Method Detail

getReturnTypeback to summary
public Type getReturnType(Type firstArgument, 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
firstArgument: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 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 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 String render(Type firstArgument, 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
firstArgument: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.
renderback to summary
protected abstract String render(TrimFunctionTemplate.Options options, String trimSource, SessionFactoryImplementor factory)

Deprecated

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

org.hibernate.dialect.function back to summary

protected Class TrimFunctionTemplate.Options

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final String
private String
private TrimFunctionTemplate.Specification

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public String
public TrimFunctionTemplate.Specification
public void
setTrimCharacter(String trimCharacter)

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_TRIM_CHARACTERback to summary
public static final String DEFAULT_TRIM_CHARACTER
trimCharacterback to summary
private String trimCharacter
trimSpecificationback to summary
private TrimFunctionTemplate.Specification trimSpecification

Constructor Detail

Optionsback to summary
protected Options()

Method Detail

getTrimCharacterback to summary
public String getTrimCharacter()
getTrimSpecificationback to summary
public TrimFunctionTemplate.Specification getTrimSpecification()
setTrimCharacterback to summary
public void setTrimCharacter(String trimCharacter)
setTrimSpecificationback to summary
public void setTrimSpecification(TrimFunctionTemplate.Specification trimSpecification)
org.hibernate.dialect.function back to summary

protected Class TrimFunctionTemplate.Specification

extends Object
Class Inheritance
  • java.lang.Object
  • org.hibernate.dialect.function.TrimFunctionTemplate.Specification

Field Summary

Modifier and TypeField and Description
public static final TrimFunctionTemplate.Specification
public static final TrimFunctionTemplate.Specification
private final String
public static final TrimFunctionTemplate.Specification

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BOTHback to summary
public static final TrimFunctionTemplate.Specification BOTH
LEADINGback to summary
public static final TrimFunctionTemplate.Specification LEADING
nameback to summary
private final String name
TRAILINGback to summary
public static final TrimFunctionTemplate.Specification TRAILING

Constructor Detail

Specificationback to summary
private Specification(String name)

Method Detail

getNameback to summary
public String getName()