import com.marcozanon.macaco.MObject;
import com.marcozanon.macaco.text.MText;
import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
import java.util.LinkedList;
public class MSqlTable extends MObject {
p);
}
+ public MSqlStatementResults deleteRecords(LinkedHashSet idSet) throws MStatementSqlException {
+ if (null == idSet) {
+ throw new IllegalArgumentException("Invalid 'idSet': null.");
+ }
+ //
+ StringBuilder whereClause = new StringBuilder("(0)");
+ LinkedList<Object> p = new LinkedList<Object>();
+ for (Object id: idSet) {
+ whereClause.append(" OR (\"" + this.getTable() + "\".\"" + this.getPrimaryKey() + "\" = ?)");
+ p.add(id);
+ }
+ return this.getConnectionReference().executePreparedStatement(" DELETE FROM \"" + this.getTable() + "\""
+ + " WHERE (" + whereClause + ")",
+ p);
+ }
+
}