StandardSQLFunction, with an unlimited number of arguments.
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final String | |
| private final Type | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | VarArgsSQLFunction(Type
The return type. registeredType, String The beginning of the function templating. begin, String The separator for each individual function argument. sep, String The end of the function templating. end)Constructs a VarArgsSQLFunction instance with a 'static' return type. |
| public | VarArgsSQLFunction(String
The beginning of the function templating. begin, String The separator for each individual function argument. sep, String The end of the function templating. end)Constructs a VarArgsSQLFunction instance with a 'dynamic' return type. |
| Modifier and Type | Method and Description |
|---|---|
| public Type | getReturnType(Type
The type of the first argument firstArgumentType, Mapping The mapping source. mapping)Implements org. |
| public boolean | hasArguments()
Implements org. |
| public boolean | hasParenthesesIfNoArguments()
Implements org. |
| public String | render(Type
The type of the first argument firstArgumentType, List<E> The function arguments arguments, SessionFactoryImplementor The SessionFactory factory)Implements org. |
| protected String | Returns: The transformed argument; may be the same, though should never be null.The argument being processed. argument)Called from |
| begin | back to summary |
|---|---|
| private final String begin | |
| end | back to summary |
|---|---|
| private final String end | |
| registeredType | back to summary |
|---|---|
| private final Type registeredType | |
| sep | back to summary |
|---|---|
| private final String sep | |
| VarArgsSQLFunction | back to summary |
|---|---|
| public VarArgsSQLFunction(Type registeredType, String begin, String sep, String end) Constructs a VarArgsSQLFunction instance with a 'static' return type. An example of a 'static' return type would be something like an UPPER function which is always returning a SQL VARCHAR and thus a string type. | |
| VarArgsSQLFunction | back to summary |
|---|---|
| public VarArgsSQLFunction(String begin, String sep, String end) Constructs a VarArgsSQLFunction instance with a 'dynamic' return type. For a dynamic return type, the type of the arguments are used to resolve the type. An example of a function with a 'dynamic' return would be MAX or MIN which return a double or an integer etc based on the types of the arguments.
| |
| getReturnType | back to summary |
|---|---|
| public Type getReturnType(Type firstArgumentType, Mapping mapping) throws QueryException Implements org. Doc from org. 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
| |
| hasArguments | back to summary |
|---|---|
| public boolean hasArguments() Implements org. Doc from org. Does this function have any arguments? Always returns true here.
| |
| hasParenthesesIfNoArguments | back to summary |
|---|---|
| public boolean hasParenthesesIfNoArguments() Implements org. Doc from org. If there are no arguments, are parentheses required? Always returns true here.
| |
| render | back to summary |
|---|---|
| public String render(Type firstArgumentType, List<E> arguments, SessionFactoryImplementor factory) Implements org. Doc from org. Render the function call as SQL fragment.
Note, the 'firstArgumentType' parameter should match the one passed into
| |
| transformArgument | back to summary |
|---|---|
| protected String transformArgument(String argument) Called from | |