Package org.hibernate.dialect.function
Class ConditionalParenthesisFunction
- java.lang.Object
-
- org.hibernate.dialect.function.StandardSQLFunction
-
- org.hibernate.dialect.function.ConditionalParenthesisFunction
-
- All Implemented Interfaces:
SQLFunction
public class ConditionalParenthesisFunction extends StandardSQLFunction
Essentially the same asStandardSQLFunction, except that here the parentheses are not included when no arguments are given.
-
-
Constructor Summary
Constructors Constructor Description ConditionalParenthesisFunction(String name)Constructs a ConditionalParenthesisFunction with the given nameConditionalParenthesisFunction(String name, Type type)Constructs a ConditionalParenthesisFunction with the given name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasParenthesesIfNoArguments()If there are no arguments, are parentheses required?Stringrender(Type firstArgumentType, List arguments, SessionFactoryImplementor sessionFactory)Render the function call as SQL fragment.-
Methods inherited from class org.hibernate.dialect.function.StandardSQLFunction
getName, getRenderedName, getReturnType, getType, hasArguments, toString
-
-
-
-
Constructor Detail
-
ConditionalParenthesisFunction
public ConditionalParenthesisFunction(String name)
Constructs a ConditionalParenthesisFunction with the given name- Parameters:
name- The function name
-
-
Method Detail
-
hasParenthesesIfNoArguments
public boolean hasParenthesesIfNoArguments()
Description copied from interface:SQLFunctionIf there are no arguments, are parentheses required?- Specified by:
hasParenthesesIfNoArgumentsin interfaceSQLFunction- Overrides:
hasParenthesesIfNoArgumentsin classStandardSQLFunction- Returns:
- True if a no-arg call of this function requires parentheses.
-
render
public String render(Type firstArgumentType, List arguments, SessionFactoryImplementor sessionFactory)
Description copied from interface:SQLFunctionRender the function call as SQL fragment. Note, the 'firstArgumentType' parameter should match the one passed intoSQLFunction.getReturnType(org.hibernate.type.Type, org.hibernate.engine.spi.Mapping)- Specified by:
renderin interfaceSQLFunction- Overrides:
renderin classStandardSQLFunction- Parameters:
firstArgumentType- The type of the first argumentarguments- The function argumentssessionFactory- The SessionFactory- Returns:
- The rendered function call
-
-