com.github.drinkjava2.jdialects
Class DialectFunctionTranslator

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

public class DialectFunctionTranslator
extends Object

TranslateUtil parse a Sql, translate all universal functions like fn_sin() to native SQL functions like sin()

Since:
1.0.0
Author:
Yong Zhu (Yong9981@gmail.com)

Nested Class Summary
static class DialectFunctionTranslator.SqlItem
          Item type can be:
S:String, F:function, U:Unknow(need correct), ",":","
 
Field Summary
static DialectFunctionTranslator instance
           
 
Constructor Summary
DialectFunctionTranslator()
          Register functions names need translated, values is percentage of dialects support this function, value not used for this project
 
Method Summary
static void deleteItem(DialectFunctionTranslator.SqlItem item)
           
static void deleteItem(DialectFunctionTranslator.SqlItem lastItem, DialectFunctionTranslator.SqlItem nextItem)
           
 String doTranslate(Dialect d, String sql)
          Translate universal SQL to native SQL, all #xxx() format universal SQL functions will be translate to xxx() native SQL functions
 Map<String,Integer> getFunctionMap()
           
static boolean isLetterNumber(char c)
           
 void setFunctionMap(Map<String,Integer> functionMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

public static final DialectFunctionTranslator instance
Constructor Detail

DialectFunctionTranslator

public DialectFunctionTranslator()
Register functions names need translated, values is percentage of dialects support this function, value not used for this project

Method Detail

getFunctionMap

public Map<String,Integer> getFunctionMap()

setFunctionMap

public void setFunctionMap(Map<String,Integer> functionMap)

doTranslate

public String doTranslate(Dialect d,
                          String sql)
Translate universal SQL to native SQL, all #xxx() format universal SQL functions will be translate to xxx() native SQL functions


deleteItem

public static void deleteItem(DialectFunctionTranslator.SqlItem item)

deleteItem

public static void deleteItem(DialectFunctionTranslator.SqlItem lastItem,
                              DialectFunctionTranslator.SqlItem nextItem)

isLetterNumber

public static boolean isLetterNumber(char c)


Copyright © 2018. All rights reserved.