// ignore the first token since we are assuming read all query
// e.g. In e.phoneNumbers we will assume "e" refers to the base of the query
String previousToken = tokenizer.nextToken();
olrq.checkDescriptor(activeSession);
ClassDescriptor descriptor = olrq.getDescriptor();
Expression expression = olrq.getExpressionBuilder();
while (tokenizer.hasMoreTokens()){
String token = tokenizer.nextToken();
ForeignReferenceMapping frMapping = null;
DatabaseMapping mapping = descriptor.getObjectBuilder().getMappingForAttributeName(token);
if (mapping == null){
throw QueryException.queryHintNavigatedNonExistantRelationship(query, QueryHints.LEFT_FETCH, valueToApply, previousToken + "." + token);
} else if (!mapping.isForeignReferenceMapping()){
while (mapping.isAggregateObjectMapping() && tokenizer.hasMoreTokens()){
expression = expression.get(token);
token = tokenizer.nextToken();
descriptor = ((org.eclipse.persistence.mappings.AggregateObjectMapping)mapping).getReferenceDescriptor();
mapping = descriptor.getObjectBuilder().getMappingForAttributeName(token);
}
if (!mapping.isForeignReferenceMapping()){
throw QueryException.queryHintNavigatedIllegalRelationship(query, QueryHints.LEFT_FETCH, valueToApply, previousToken + "." + token);
}
}
frMapping = (ForeignReferenceMapping)mapping;
descriptor = frMapping.getReferenceDescriptor();
if (frMapping.isCollectionMapping()){
expression = expression.anyOfAllowingNone(token, false);
} else {
expression = expression.getAllowingNull(token);
}
previousToken = token;
}
olrq.addJoinedAttribute(expression);
} else {