【Java开源代码栏目提醒】:网学会员在Java开源代码频道为大家收集整理了ASTSQLParser.java提供大家参考,希望对大家有所帮助!
package com.cownew.CowNewSQL.common;
import com.cownew.CowNewSQL.ISQLTranslator;
import com.cownew.SQLParser.ast.node.stmt.SqlDeleteStmtAST;
import com.cownew.SQLParser.ast.node.stmt.SqlInsertBodyAST;
import com.cownew.SQLParser.ast.node.stmt.SqlSelectStmtAST;
import com.cownew.SQLParser.ast.node.stmt.SqlUpdateBodyAST;
public class ASTSQLParser
{
public static String translateSelectAST(SqlSelectStmtAST stmtAST,DataBaseTypeEnum dbType)
throws TranslateException
{
return getTranslator(dbType).translateStmt(stmtAST);
}
public static String translateUpdateStmt(SqlUpdateBodyAST stmtAST,DataBaseTypeEnum dbType)
throws TranslateException
{
return getTranslator(dbType).translateStmt(stmtAST);
}
public static String translateInsertStmt(SqlInsertBodyAST stmtAST,DataBaseTypeEnum dbType)
throws TranslateException
{
return getTranslator(dbType).translateStmt(stmtAST);
}
public static String translateDeleteStmt(SqlDeleteStmtAST stmtAST,DataBaseTypeEnum dbType)
throws TranslateException
{
return getTranslator(dbType).translateStmt(stmtAST);
}
private static ISQLTranslator getTranslator(DataBaseTypeEnum dbType)
{
return DialectManager.getTranslator(dbType);
}
}
上一篇:
ASTQueryTranslatorTest.java
下一篇:
多年来只想说一句,我不怪你