concat(?1, ?2) to concatenate two strings
p1 and p2. Target SQL function will be dialect-specific, e.g. (?1 || ?2) for
Oracle, concat(?1, ?2) for MySql, (?1 + ?2) for MS SQL.
Each dialect will define a template as a string (exactly like above) marking function
parameters with '?' followed by parameter's index (first index is 1).
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final TemplateRenderer | |
| private final Type |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Type | getReturnType(Type
The type of the first argument argumentType, 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 argumentType, List<E> The function arguments args, SessionFactoryImplementor The SessionFactory factory)Implements org. |
| public String |
| hasParenthesesIfNoArgs | back to summary |
|---|---|
| private final boolean hasParenthesesIfNoArgs | |
| renderer | back to summary |
|---|---|
| private final TemplateRenderer renderer | |
| type | back to summary |
|---|---|
| private final Type type | |
| SQLFunctionTemplate | back to summary |
|---|---|
| public SQLFunctionTemplate(Type type, String template) | |
| SQLFunctionTemplate | back to summary |
|---|---|
| public SQLFunctionTemplate(Type type, String template, boolean hasParenthesesIfNoArgs) | |
| getReturnType | back to summary |
|---|---|
| public Type getReturnType(Type argumentType, 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?
| |
| hasParenthesesIfNoArguments | back to summary |
|---|---|
| public boolean hasParenthesesIfNoArguments() Implements org. Doc from org. If there are no arguments, are parentheses required?
| |
| render | back to summary |
|---|---|
| public String render(Type argumentType, List<E> args, SessionFactoryImplementor factory) Implements org. Doc from org. Render the function call as SQL fragment.
Note, the 'firstArgumentType' parameter should match the one passed into
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |