use of info.xiancloud.dao.jdbc.sql.AbstractAction in project xian by happyyangyuan.
the class DaoUnit method logSql.
/**
* 打印sql语句,它不会将sql执行,只是打印sql语句。
* 仅供内部测试使用
*/
public static void logSql(Class daoUnitClass, Map map) {
try (Connection conn = DriverManager.getConnection(DatasourceConfigReader.getWriteUrl(), DatasourceConfigReader.getWriteUser(), DatasourceConfigReader.getWritePwd())) {
DaoUnit daoUnit = (DaoUnit) daoUnitClass.newInstance();
for (Action action : daoUnit.getActions()) {
((AbstractAction) action).setConnection(conn);
((AbstractAction) action).setMap(map);
/*((AbstractAction) action).create();*/
action.logSql(map);
}
} catch (Throwable t) {
t.printStackTrace();
}
}
Aggregations