}
}
else if (mainTable instanceof DatastoreMap)
{
// Check for a key field first
DatastoreMap join = (DatastoreMap)mainTable;
JavaTypeMapping m = join.getKeyMapping();
if (m instanceof EmbeddedKeyPCMapping)
{
JavaTypeMapping fieldMapping = ((EmbeddedMapping)m).getJavaTypeMapping(fld);
if (fieldMapping != null)
{
return fieldMapping.newScalarExpression(qs, this);
}
}
// Check for a value field next
m = join.getValueMapping();
if (m instanceof EmbeddedValuePCMapping)
{
JavaTypeMapping fieldMapping = ((EmbeddedMapping)m).getJavaTypeMapping(fld);
if (fieldMapping != null)
{