if (joinExprs != null)
{
for (int i=0;i<joinExprs.length;i++)
{
JoinExpression joinExpr = joinExprs[i];
String joinFieldName = joinExpr.getFieldName();
boolean complete = false;
int joinNum = 0;
while (!complete)
{
// Split the join field name into components so we have "alias.field"
// If the join field name is of the form "a.b.c.d" then this will mean multiple joins
int sepPos1 = joinFieldName.indexOf('.');
if (sepPos1 < 0)
{
// No join since no "alias.field" form
break;
}
int sepPos2 = joinFieldName.indexOf('.', sepPos1+1);
if (sepPos2 < 0)
{
complete = true;
sepPos2 = joinFieldName.length();
}
String leftAlias = joinFieldName.substring(0, sepPos1);
String fieldName = joinFieldName.substring(sepPos1+1, sepPos2);
String rightAlias = null;
if (complete)
{
rightAlias = joinExpr.getAlias();
}
else
{
rightAlias = "TMP" + joinNum;
}
if (joinExpr.getFieldName().equals(leftAlias + '.' + fieldName))
{
// No internal joins needed, so just process the compiled JoinExpression
processJoinExpression(joinExpr);
}
else
{
// Internal joins needed, so construct and process this component
JoinExpression expr = new JoinExpression(qs, leftAlias + '.' + fieldName,
joinExpr.isLeftJoin(), joinExpr.isFetch());
if (rightAlias != null)
{
expr.as(rightAlias);
}
processJoinExpression(expr);
if (!complete)
{