for (DbAttribute attribute : batch.getDbEntity().getGeneratedAttributes()) {
// batch can have generated attributes that are not PKs, e.g. columns with
// DB DEFAULT values. Ignore those.
if (attribute.isPrimaryKey()) {
Object value = key.values().iterator().next();
// I guess we should override any existing value,
// as generated key is the latest thing that exists in the DB.
id.getReplacementIdMap().put(attribute.getName(), value);
break;