oRSet.close();
}
oDlte.close();
}
else {
CallableStatement oCall = oConn.prepareCall("{ call k_sp_del_mime_msg(?) }");
for (int m=0; m<iObjs; m++) {
oCall.setString(1, oObjs.getString(0,m));
oCall.execute();
}
oCall.close();
}
} // fi (exists(k_mime_msgs))
oObjs = null;
if (DBBind.exists(oConn, DB.k_x_company_prods, "U")) {
oStmt = oConn.createStatement();
if (DebugFile.trace)
DebugFile.writeln("Statement.executeUpdate(DELETE FROM " + DB.k_x_company_prods + " WHERE " + DB.gu_category + "='" + sCategoryGUID + "')");
oStmt.executeUpdate("DELETE FROM " + DB.k_x_company_prods + " WHERE " + DB.gu_category + "='" + sCategoryGUID + "'");
oStmt.close();
} // fi (k_x_company_prods)
if (DBBind.exists(oConn, DB.k_x_contact_prods, "U")) {
oStmt = oConn.createStatement();
if (DebugFile.trace)
DebugFile.writeln("Statement.executeUpdate(DELETE FROM " + DB.k_x_contact_prods + " WHERE " + DB.gu_category + "='" + sCategoryGUID + "')");
oStmt.executeUpdate("DELETE FROM " + DB.k_x_contact_prods + " WHERE " + DB.gu_category + "='" + sCategoryGUID + "'");
oStmt.close();
} // fi (k_x_contact_prods)
// Saca la lista de categorías hijas de primer nivel y repite el proceso de borrado
LinkedList oChilds = oCat.browse(oConn, BROWSE_DOWN, BROWSE_BOTTOMUP);
ListIterator oIter = oChilds.listIterator();
while (oIter.hasNext()) {
oCat = (Category) oIter.next();
oCat.delete(oConn);
} // wend
if (oConn.getDataBaseProduct()==JDCConnection.DBMS_POSTGRESQL) {
if (DebugFile.trace) DebugFile.writeln("Connection.executeQuery(SELECT k_sp_del_category_r ('" + sCategoryGUID + "'))");
oStmt = oConn.createStatement();
oStmt.executeQuery("SELECT k_sp_del_category_r ('" + sCategoryGUID + "')");
oStmt.close();
bRetVal = true;
} else {
if (DebugFile.trace) DebugFile.writeln("Connection.prepareCall({call k_sp_del_category_r('" + sCategoryGUID + "')})");
CallableStatement oCall = oConn.prepareCall("{call k_sp_del_category_r ('" + sCategoryGUID + "')}");
bRetVal = oCall.execute();
oCall.close();
}
if (DebugFile.trace) {
DebugFile.decIdent();
DebugFile.writeln("End Category.delete() : " + String.valueOf(bRetVal));