public class VarArgsSQLFunction extends Object implements SQLFunction
StandardSQLFunction
, with an unlimited number of arguments.Constructor and Description |
---|
VarArgsSQLFunction(String begin,
String sep,
String end)
Constructs a VarArgsSQLFunction instance with a 'dynamic' return type.
|
VarArgsSQLFunction(Type registeredType,
String begin,
String sep,
String end)
Constructs a VarArgsSQLFunction instance with a 'static' return type.
|
Modifier and Type | Method and Description |
---|---|
Type |
getReturnType(Type firstArgumentType,
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 firstArgumentType,
List arguments,
SessionFactoryImplementor factory)
Render the function call as SQL fragment.
|
protected String |
transformArgument(String argument)
Called from
render(org.hibernate.type.Type, java.util.List, org.hibernate.engine.spi.SessionFactoryImplementor) to allow applying a change or transformation
to each individual argument. |
public VarArgsSQLFunction(Type registeredType, String begin, String sep, String end)
registeredType
- The return type.begin
- The beginning of the function templating.sep
- The separator for each individual function argument.end
- The end of the function templating.public VarArgsSQLFunction(String begin, String sep, String end)
begin
- The beginning of the function templating.sep
- The separator for each individual function argument.end
- The end of the function templating.Specifically, the 'firstArgumentType' argument is the 'dynamic' type.
public boolean hasArguments()
hasArguments
in interface SQLFunction
public boolean hasParenthesesIfNoArguments()
hasParenthesesIfNoArguments
in interface SQLFunction
public Type getReturnType(Type firstArgumentType, Mapping mapping) throws QueryException
SQLFunction.render(org.hibernate.type.Type, java.util.List, org.hibernate.engine.spi.SessionFactoryImplementor)
getReturnType
in interface SQLFunction
firstArgumentType
- The type of the first argumentmapping
- The mapping source.QueryException
- Indicates an issue resolving the return type.public String render(Type firstArgumentType, List arguments, SessionFactoryImplementor factory)
SQLFunction
SQLFunction.getReturnType(org.hibernate.type.Type, org.hibernate.engine.spi.Mapping)
render
in interface SQLFunction
firstArgumentType
- The type of the first argumentarguments
- The function argumentsfactory
- The SessionFactoryprotected String transformArgument(String argument)
render(org.hibernate.type.Type, java.util.List, org.hibernate.engine.spi.SessionFactoryImplementor)
to allow applying a change or transformation
to each individual argument.argument
- The argument being processed.Copyright © 2018 JBoss by Red Hat. All rights reserved.