}
private void saveObjectToDB() {
Row mainRow = container.getCurrentRow();
BaseClass object = container.getObject();
String action = container.getAction();
//make childRow primaryKey equals to mainRow primaryKey
Iterator childRowIter = mainRow.getRowSet().getRows().iterator();
while (childRowIter.hasNext()) {
Row childRow = (Row)childRowIter.next();
if (childRow != mainRow) {
Iterator childRowCellIter = childRow.getNewCells().iterator();
while (childRowCellIter.hasNext()) {
Cell childRowCell = (Cell)childRowCellIter.next();
Column tColumn = ObjectUtil.findColumn(container.getObject(), childRowCell.getTableName(), childRowCell.getColumnName());
if ( (tColumn.isPrimaryKey()) && (tColumn.getTableName().equals(container.getObject().getChildTableName())) ) {
Cell mainRowCell = ObjectUtil.findNewCell(mainRow, container.getObject().getMainTableName(), childRowCell.getColumnName());
if (mainRowCell != null)
childRowCell.setColumnValue(mainRowCell.getColumnValue());
}
/*if ( (tColumn.getTableName().equals("PA")) && (tColumn.getColumnName().equals("PUBKEY")) )
childRowCell.setColumnValue(null);
if ( (tColumn.getTableName().equals("PA")) && (tColumn.getColumnName().equals("PRIKEY")) )
childRowCell.setColumnValue(null);*/
}
}
}
if (action.equals("Add"))
object.classInsert_WholeObject(mainRow, false);
else if (action.equals("Edit"))
object.classUpdate_WholeObject(mainRow, false);
}