private String getDeleteSQL(Predicate predicate) {
StringBuilder whereClause = new StringBuilder();
if (predicate instanceof BasePredicate) {
BasePredicate basePredicate = (BasePredicate) predicate;
SQLPredicateVisitor visitor = new SQLPredicateVisitor();
basePredicate.accept(visitor);
whereClause.append(visitor.getSQL());
String table = PropertyHelper.getPropertyCategory(basePredicate.getPropertyIds().iterator().next());
return "delete from " + table + " where " + whereClause;
}
throw new IllegalStateException("Can't generate SQL.");
}