queryWhereClause.add(joinConditionStringBuilder.toString());
}
else
{
Criterion joinCondition = join.getJoinCondition();
// get the table names
// (and the alias names for them if necessary))
PreparedStatementPart leftExpression;
if (join.getLeftTable() != null)
{
leftExpression = join.getLeftTable();
}
else
{
if (joinCondition.isComposite())
{
throw new TorqueException(
"join condition is composite "
+ "and there is no leftTable defined "
+ "in the join. "
+ "Please define a leftTable in the join");
}
Object lValue = joinCondition.getLValue();
leftExpression = SqlBuilder.getExpressionForFromClause(
lValue,
criteria);
}
PreparedStatementPart rightExpression;
if (join.getRightTable() != null)
{
rightExpression = join.getRightTable();
}
else
{
if (joinCondition.isComposite())
{
throw new TorqueException(
"join condition is composite "
+ "and there is no rightTable defined "
+ "in the join. "
+ "Please define a rightTable in the join");
}
Object rValue = joinCondition.getRValue();
rightExpression = SqlBuilder.getExpressionForFromClause(
rValue,
criteria);
}