// Extract target field and its value. Construct insert statement and execute it
int size = targetPrimaryKeyFields.size();
int objectIndex = 0;
for (Object iter = cp.iteratorFor(objects); cp.hasNext(iter);) {
AbstractRecord databaseRow = new DatabaseRecord();
databaseRow.mergeFrom(keyRow);
Object wrappedObject = cp.nextEntry(iter, query.getSession());
Object object = cp.unwrapIteratorResult(wrappedObject);
for(int index = 0; index < size; index++) {
DatabaseField targetPrimaryKey = targetPrimaryKeyFields.get(index);
Object targetKeyValue = getReferenceDescriptor().getObjectBuilder().extractValueFromObjectForField(object, targetPrimaryKey, query.getSession());