com.github.drinkjava2.jdialects
Class FunctionUtils

java.lang.Object
  extended by com.github.drinkjava2.jdialects.FunctionUtils

public class FunctionUtils
extends Object

Function features Utils

Since:
1.0.2
Author:
Yong Zhu

Constructor Summary
FunctionUtils()
           
 
Method Summary
protected static String render(Dialect d, String functionName, Object... args)
          The render method translate function template to real SQL piece
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionUtils

public FunctionUtils()
Method Detail

render

protected static String render(Dialect d,
                               String functionName,
                               Object... args)
The render method translate function template to real SQL piece
 Template can be:
 "*": standard SQL function, identical to abc($Params)
 "abc($Params)": template with special parameter format:  
                                        "$P1, $P2, $P3, $P4, $P5, $P6..."="$Params"
                                        "$P1,$P2,$P3,$P4,$P5,$P6..."="$Compact_Params"
                                        "$P1||$P2||$P3||$P4||$P5||$P6..."="$Lined_Params"
                                        "$P1+$P2+$P3+$P4+$P5+$P6..."="$Add_Params");
                                        "$P1 in $P2 in $P3 in $P4 in $P5 in $P6..."="$IN_Params"
                                "$P1%pattern$P2%pattern$P3%pattern$P4%pattern$P5%pattern$P6..."="$Pattern_Params"
                                        "11%startswith$P2%startswith$P3%startswith$P4%startswith$P5%startswith$P6..."= "$Startswith_Params");
                                         "nvl($P1, nvl($P2, nvl($P3, nvl($P4, nvl($P5, $P6...)))))"="$NVL_Params");
 
 "0=abc()": function do not support parameter
 "1=abc($P1)": function only support 1 parameter
 "2=abc($P1,$P2)": function only support 2 parameters
 "0=abc()|1=abc($P1)|3=abc($P1,$P2,$P3)": function support 0 or 1 or 3 parameters
 
 

Parameters:
functionName - function name
args - function parameters
Returns:
A SQL function piece


Copyright © 2017. All rights reserved.