org.hibernate.dialect.function

Class ConditionalParenthesisFunction

Implemented Interfaces:
SQLFunction

public class ConditionalParenthesisFunction
extends StandardSQLFunction

Essentially the same as StandardSQLFunction, except that here the parentheses are not included when no arguments are given.
Author:
Jonathan Levinson

Constructor Summary

ConditionalParenthesisFunction(String name)
ConditionalParenthesisFunction(String name, Type type)

Method Summary

boolean
hasParenthesesIfNoArguments()
If there are no arguments, are parens required?
String
render(List args, SessionFactoryImplementor factory)
Render the function call as SQL fragment.

Methods inherited from class org.hibernate.dialect.function.StandardSQLFunction

getName, getReturnType, getType, hasArguments, hasParenthesesIfNoArguments, render, toString

Constructor Details

ConditionalParenthesisFunction

public ConditionalParenthesisFunction(String name)

ConditionalParenthesisFunction

public ConditionalParenthesisFunction(String name,
                                      Type type)

Method Details

hasParenthesesIfNoArguments

public boolean hasParenthesesIfNoArguments()
If there are no arguments, are parens required?
Specified by:
hasParenthesesIfNoArguments in interface SQLFunction
Overrides:
hasParenthesesIfNoArguments in interface StandardSQLFunction
Returns:
True if a no-arg call of this function requires parentheses.

render

public String render(List args,
                     SessionFactoryImplementor factory)
Render the function call as SQL fragment.
Specified by:
render in interface SQLFunction
Overrides:
render in interface StandardSQLFunction
Parameters:
args - The function arguments
factory - The SessionFactory
Returns:
The rendered function call