Object sourceKeyValue = writeQuery.getTranslationRow().get(sourceKey);
writeQuery.getTranslationRow().put(referenceKey, sourceKeyValue);
}
for (Iterator iterator = changeRecord.getRemoveObjectMap().keySet().iterator(); iterator.hasNext();){
Object object = iterator.next();
AbstractRecord thisRow = (AbstractRecord)writeQuery.getTranslationRow().clone();
Object value = object;
if (getValueConverter() != null){
value = getValueConverter().convertObjectValueToDataValue(value, writeQuery.getSession());
}
if (value == DirectCollectionChangeRecord.Null){
thisRow.add(getDirectField(), null);
}else{
thisRow.add(getDirectField(), value);
}
// Hey I might actually want to use an inner class here... ok array for now.
Object[] event = new Object[3];
event[0] = Delete;
event[1] = getDeleteQuery();
event[2] = thisRow;
writeQuery.getSession().getCommitManager().addDataModificationEvent(this, event);
Integer count = (Integer)changeRecord.getCommitAddMap().get(object);
if (count != null){
for (int counter = count.intValue(); counter > 0; --counter){
thisRow = (AbstractRecord)writeQuery.getTranslationRow().clone();
thisRow.add(getDirectField(), value);
// Hey I might actually want to use an inner class here... ok array for now.
event = new Object[3];
event[0] = Insert;
event[1] = getInsertQuery();
event[2] = thisRow;
writeQuery.getSession().getCommitManager().addDataModificationEvent(this, event);
}
}
}
for (Iterator iterator = changeRecord.getAddObjectMap().keySet().iterator(); iterator.hasNext();){
Object object = iterator.next();
Integer count = (Integer)changeRecord.getAddObjectMap().get(object);
for (int counter = count.intValue(); counter > 0; --counter){
AbstractRecord thisRow = (AbstractRecord)writeQuery.getTranslationRow().clone();
Object value = object;
if (getValueConverter() != null){
value = getValueConverter().convertObjectValueToDataValue(value, writeQuery.getSession());
}
if (value == DirectCollectionChangeRecord.Null){ //special placeholder for nulls
thisRow.add(getDirectField(), null);
}else{
thisRow.add(getDirectField(), value);
}
// Hey I might actually want to use an inner class here... ok array for now.
Object[] event = new Object[3];
event[0] = Insert;
event[1] = getInsertQuery();