public class NoArgSQLFunction extends Object implements SQLFunction
A function which takes no arguments
| Constructor and Description |
|---|
NoArgSQLFunction(String name,
Type returnType)
Constructs a NoArgSQLFunction
|
NoArgSQLFunction(String name,
Type returnType,
boolean hasParenthesesIfNoArguments)
Constructs a NoArgSQLFunction
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
getName() |
Type |
getReturnType(Type argumentType,
Mapping mapping)
The return type of the function.
|
boolean |
hasArguments()
Does this function have any arguments?
|
boolean |
hasParenthesesIfNoArguments()
If there are no arguments, are parentheses required?
|
String |
render(Type argumentType,
List args,
SessionFactoryImplementor factory)
Render the function call as SQL fragment.
|
public NoArgSQLFunction(String name, Type returnType)
Constructs a NoArgSQLFunction
name - The function namereturnType - The function return typepublic NoArgSQLFunction(String name, Type returnType, boolean hasParenthesesIfNoArguments)
Constructs a NoArgSQLFunction
name - The function namereturnType - The function return typehasParenthesesIfNoArguments - Does the function call need parenthesis if there are no arguments?public boolean hasArguments()
SQLFunctionDoes this function have any arguments?
hasArguments in interface SQLFunctionpublic boolean hasParenthesesIfNoArguments()
SQLFunctionIf there are no arguments, are parentheses required?
hasParenthesesIfNoArguments in interface SQLFunctionpublic Type getReturnType(Type argumentType, Mapping mapping) throws QueryException
SQLFunctionThe 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.
<p/>
Note, the 'firstArgumentType' parameter should match the one passed into SQLFunction.render(org.hibernate.type.Type, java.util.List, org.hibernate.engine.spi.SessionFactoryImplementor)
getReturnType in interface SQLFunctionargumentType - The type of the first argumentmapping - The mapping source.QueryException - Indicates an issue resolving the return type.public String render(Type argumentType, List args, SessionFactoryImplementor factory) throws QueryException
SQLFunctionRender the function call as SQL fragment.
<p/>
Note, the 'firstArgumentType' parameter should match the one passed into SQLFunction.getReturnType(org.hibernate.type.Type, org.hibernate.engine.spi.Mapping)
render in interface SQLFunctionargumentType - The type of the first argumentargs - The function argumentsfactory - The SessionFactoryQueryException - Indicates a problem rendering the
function call.protected String getName()
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.