Row row = (Row)regDatas.get(0);
Vector notAssignedRowDatas = (Vector)regDatas.get(1);
Vector assignedRowDatas = (Vector)regDatas.get(2);
int r = 0;
Cell cell = ObjectUtil.findNewCell(row, "RI", "R");
if (cell.getColumnValue() instanceof Number)
r = ((Number)cell.getColumnValue()).intValue();
else
r = Integer.parseInt((String)cell.getColumnValue());
int ri = 0;
cell = ObjectUtil.findNewCell(row, "RI", "RI");
if (cell.getColumnValue() instanceof Number)
ri = ((Number)cell.getColumnValue()).intValue();
else
ri = Integer.parseInt((String)cell.getColumnValue());
DAO dao = DAO.getInstance();
Iterator nardsIter = notAssignedRowDatas.iterator();
while (nardsIter.hasNext()) {
Vector rowData = (Vector)nardsIter.next();
dao.update(Resources.DELETE_BI_SQL);
dao.setObject(1, r);
dao.setObject(2, ri);
dao.setObject(3, rowData.get(0));
dao.setObject(4, rowData.get(1));
dao.setObject(5, rowData.get(2));
dao.executeUpdate();
}
Iterator ardIter = assignedRowDatas.iterator();
while (ardIter.hasNext()) {
Vector rowData = (Vector)ardIter.next();
dao.query(Resources.SELECT_BI_BY_ALLPK_SQL);
dao.setObject(1, r);
dao.setObject(2, ri);
dao.setObject(3, rowData.get(0));
dao.setObject(4, rowData.get(1));
dao.setObject(5, rowData.get(2));
ResultSet rs = dao.executeQuery();
try {
if (rs.next()) {
dao.update(Resources.UPDATE_BI_SQL);
dao.setObject(1, rowData.get(4));
dao.setObject(2, rowData.get(5));
cell = ObjectUtil.findNewCell(row, "RI", "TXT256");
dao.setObject(3, cell.getColumnValue());
dao.setObject(4, r);
dao.setObject(5, ri);
dao.setObject(6, rowData.get(0));
dao.setObject(7, rowData.get(1));
dao.setObject(8, rowData.get(2));
dao.executeUpdate();
} else {
dao.update(Resources.ADD_BI_SQL);
dao.setObject(1, r);
dao.setObject(2, ri);
dao.setObject(3, rowData.get(0));
dao.setObject(4, rowData.get(1));
dao.setObject(5, rowData.get(2));
dao.setObject(6, rowData.get(4));
dao.setObject(7, rowData.get(5));
cell = ObjectUtil.findNewCell(row, "RI", "TXT256");
dao.setObject(8, cell.getColumnValue());
dao.executeUpdate();
}
rs.close();
result = true;
} catch (Exception e) {