use of org.sql.generation.api.grammar.builders.modification.DeleteBySearchBuilder in project qi4j-sdk by Qi4j.
the class AbstractSQLIndexing method createDeleteFromTableStatement.
protected DeleteStatement createDeleteFromTableStatement(String schemaName, String tableName, String columnName, SQLVendor vendor) {
ModificationFactory m = vendor.getModificationFactory();
BooleanFactory b = vendor.getBooleanFactory();
LiteralFactory l = vendor.getLiteralFactory();
ColumnsFactory c = vendor.getColumnsFactory();
TableReferenceFactory t = vendor.getTableReferenceFactory();
// "DELETE FROM " + "%s" + "." + "%s" + "\n" + //
// "WHERE " + "%s" + " = ? " + "\n" + //
// ";" //
DeleteBySearchBuilder delete = m.deleteBySearch();
delete.setTargetTable(m.createTargetTable(t.tableName(schemaName, tableName))).getWhere().reset(b.eq(c.colName(columnName), l.param()));
return delete.createExpression();
}
Aggregations