Top Description Methods
org.hibernate.dialect.function

public Interface SQLFunction

Known Direct Implementers
org.hibernate.dialect.function.SQLFunctionTemplate, org.hibernate.dialect.function.StandardSQLFunction, org.hibernate.dialect.function.TrimFunctionTemplate, org.hibernate.dialect.function.VarArgsSQLFunction, org.hibernate.dialect.function.AbstractAnsiTrimEmulationFunction, org.hibernate.dialect.function.CastFunction, org.hibernate.dialect.function.CharIndexFunction, org.hibernate.dialect.function.ConvertFunction, org.hibernate.dialect.function.DerbyConcatFunction, org.hibernate.dialect.function.NoArgSQLFunction, org.hibernate.dialect.function.NvlFunction, org.hibernate.dialect.function.PositionSubstringFunction
Imports
java.util.List, org.hibernate.QueryException, org.hibernate.engine.Mapping, .SessionFactoryImplementor, org.hibernate.type.Type

Provides support routines for the HQL functions as used in the various SQL Dialects Provides an interface for supporting various HQL functions that are translated to SQL. The Dialect and its sub-classes use this interface to provide details required for processing of the function.
Authors
David Channon, Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public Type

Returns:

The type to be expected as a return.
getReturnType
(Type
The type of the first argument
firstArgumentType
,
Mapping
The mapping source.
mapping
)

The return type of the function.

public boolean

Returns:

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

Does this function have any arguments?

public boolean

Returns:

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

If there are no arguments, are parentheses required?

public String

Returns:

The rendered function call
render
(Type
The type of the first argument
firstArgumentType
,
List<E>
The function arguments
arguments
,
SessionFactoryImplementor
The SessionFactory
factory
)

Render the function call as SQL fragment.

Method Detail

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

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
firstArgumentType:Type

The type of the first argument

mapping:Mapping

The mapping source.

Returns:Type

The type to be expected as a return.

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

Does this function have any arguments?

Returns:boolean

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

hasParenthesesIfNoArgumentsback to summary
public boolean hasParenthesesIfNoArguments()

If there are no arguments, are parentheses required?

Returns:boolean

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

renderback to summary
public String render(Type firstArgumentType, List<E> arguments, SessionFactoryImplementor factory) throws QueryException

Render the function call as SQL fragment.

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

Parameters
firstArgumentType:Type

The type of the first argument

arguments:List<E>

The function arguments

factory:SessionFactoryImplementor

The SessionFactory

Returns:String

The rendered function call

Exceptions
QueryException:
Indicates a problem rendering the function call.