All Downloads are FREE. Search and download functionalities are using the official Maven repository.

db.sql.api.impl.tookit.SQLPrinter Maven / Gradle / Ivy

There is a newer version: 1.7.6-RC2
Show newest version
package db.sql.api.impl.tookit;

import db.sql.api.Cmd;
import db.sql.api.DbType;
import db.sql.api.SQLMode;
import db.sql.api.SqlBuilderContext;

public class SQLPrinter {
    public static String sql(Cmd cmd) {
        return sql(DbType.MYSQL, cmd);
    }

    public static String sql(DbType dbType, Cmd cmd) {
        //创建构建SQL的上下文 数据库:MYSQL SQL模式 打印
        SqlBuilderContext sqlBuilderContext = new SqlBuilderContext(dbType, SQLMode.PRINT);
        return cmd.sql(cmd, cmd, sqlBuilderContext, new StringBuilder()).toString();
    }

    public static void print(Cmd cmd) {
        print(DbType.MYSQL, cmd);
    }

    public static void print(DbType dbType, Cmd cmd) {
        System.out.println(sql(dbType, cmd));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy