Stringsql="delete from "+table_name+StringUtil.join(" and "," where ","",strs);
returnnewSql(sql,args.toArray());
}
publicSqlbatchDelete(Object[]objs){
if(objs.length>0){
Class<?>clz=objs[0].getClass();
Desci_table=newDesc(clz);
Stringtable_name=i_table.getName();
String[]pk_fields=i_table.getFieldPkNames();
String[]pk_columns=i_table.getColumnPkNames();
Object[][]vals=newObject[objs.length][];
for(intk=0;k<objs.length;k++){
Objectobj=objs[k];
List<Object>args=newArrayList<Object>();
for(inti=0;i<pk_fields.length;i++){
Objectarg=ReflexUtil.readField(pk_fields[i],obj);
if(arg!=null&&arginstanceofDate){
arg=newTimestamp(((Date)arg).getTime());
}
args.add(arg);
}
vals[k]=args.toArray();
}
Stringsql="delete from "+table_name+StringUtil.join(getColumnRight()+" = ? and "+getColumnLeft()," where "+getColumnLeft(),getColumnRight()+" = ?",pk_columns);
returnnewSql(sql,vals);
}else{
thrownewRuntimeException("DataArray can't be null");
Stringsql="delete from "+table_name+StringUtil.join(getColumnRight()+" = ? and "+getColumnLeft()," where "+getColumnLeft(),getColumnRight()+" = ?",pk_columns);
returnnewSql(sql,vals);
}else{
thrownewRuntimeException("DataArray can't be null");