// it should be either QueryKeyExpression or FieldExpression
fieldExpression = (DataExpression)fieldObject;
}
DatabaseField field = null;
DatabaseMapping mapping = null;
if(attributeName != null) {
mapping = getDescriptor().getObjectBuilder().getMappingForAttributeName(attributeName);
if (mapping != null && !mapping.getFields().isEmpty()) {
field = mapping.getFields().get(0);
}
if(field == null) {
throw QueryException.updateAllQueryAddUpdateDoesNotDefineField(getDescriptor(), getQuery(), attributeName);
}
baseExpression = ((UpdateAllQuery)getQuery()).getExpressionBuilder().get(attributeName);
} else if (fieldExpression != null) {
// it should be either QueryKeyExpression or ExpressionBuilder
if (fieldExpression.getBaseExpression() instanceof ExpressionBuilder) {
field = getDescriptor().getObjectBuilder().getFieldForQueryKeyName(fieldExpression.getName());
}
if(field == null) {
DataExpression fieldExpressionClone = (DataExpression)fieldExpression.clone();
fieldExpressionClone.getBuilder().setQueryClass(getQuery().getReferenceClass());
fieldExpressionClone.getBuilder().setSession(getSession().getRootSession(null));
field = fieldExpressionClone.getField();
if(field == null) {
throw QueryException.updateAllQueryAddUpdateDoesNotDefineField(getDescriptor(), getQuery(), fieldExpression.toString());
}
}
mapping = getDescriptor().getObjectBuilder().getMappingForField(field);
baseExpression = fieldExpression;
}
Object valueObject = entry.getValue();
Vector fields;
Vector values;
Vector baseExpressions;
if(mapping != null && mapping.isOneToOneMapping()) {
fields = mapping.getFields();
int fieldsSize = fields.size();
values = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(fieldsSize);
baseExpressions = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(fieldsSize);
for(int i=0; i<fieldsSize; i++) {
if(valueObject instanceof ConstantExpression) {