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

public Class NoArgSQLFunction

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

A function which takes no arguments
Author
Michi

Field Summary

Modifier and TypeField and Description
private boolean
private String
private Type

Constructor Summary

AccessConstructor and Description
public
NoArgSQLFunction(String
The function name
name
,
Type
The function return type
returnType
)

Constructs a NoArgSQLFunction

public
NoArgSQLFunction(String
The function name
name
,
Type
The function return type
returnType
,
boolean
Does the function call need parenthesis if there are no arguments?
hasParenthesesIfNoArguments
)

Constructs a NoArgSQLFunction

Method Summary

Modifier and TypeMethod and Description
protected String
public 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 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
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.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

hasParenthesesIfNoArgumentsback to summary
private boolean hasParenthesesIfNoArguments
nameback to summary
private String name
returnTypeback to summary
private Type returnType

Constructor Detail

NoArgSQLFunctionback to summary
public NoArgSQLFunction(String name, Type returnType)

Constructs a NoArgSQLFunction

Parameters
name:String

The function name

returnType:Type

The function return type

NoArgSQLFunctionback to summary
public NoArgSQLFunction(String name, Type returnType, boolean hasParenthesesIfNoArguments)

Constructs a NoArgSQLFunction

Parameters
name:String

The function name

returnType:Type

The function return type

hasParenthesesIfNoArguments:boolean

Does the function call need parenthesis if there are no arguments?

Method Detail

getNameback to summary
protected String getName()
getReturnTypeback to summary
public 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 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 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.