}
Attribute attr = join.getAttribute();
tuples.add(attr.getName());
PrimaryExpression primExpr = new PrimaryExpression(new ArrayList(tuples));
JoinExpression joinExpr = new JoinExpression(primExpr, join.getAlias(), jt);
if (currentExpr instanceof ClassExpression)
{
((ClassExpression)currentExpr).setJoinExpression(joinExpr);
}
else
{
((JoinExpression)currentExpr).setJoinExpression(joinExpr);
}
currentExpr = joinExpr;
}
}
if (fetchJoins != null && !fetchJoins.isEmpty())
{
List tuples = new ArrayList();
tuples.add(getAlias());
Iterator<Fetch<X, ?>> iter = fetchJoins.iterator();
Expression currentExpr = expr;
while (iter.hasNext())
{
Fetch<X, ?> join = iter.next();
org.datanucleus.query.expression.JoinExpression.JoinType jt = org.datanucleus.query.expression.JoinExpression.JoinType.JOIN_INNER;
if (join.getJoinType() == JoinType.LEFT)
{
jt = org.datanucleus.query.expression.JoinExpression.JoinType.JOIN_LEFT_OUTER;
}
else if (join.getJoinType() == JoinType.RIGHT)
{
jt = org.datanucleus.query.expression.JoinExpression.JoinType.JOIN_RIGHT_OUTER;
}
Attribute attr = join.getAttribute();
tuples.add(attr.getName());
PrimaryExpression primExpr = new PrimaryExpression(new ArrayList(tuples));
JoinExpression joinExpr = new JoinExpression(primExpr, null, jt);
if (currentExpr instanceof ClassExpression)
{
((ClassExpression)currentExpr).setJoinExpression(joinExpr);
}
else