if (tableName == null) {
if ("resin_oid".equals(columnName))
return new OidExpr(fromItems[0].getTable(), 0);
for (int i = 0; i < fromItems.length; i++) {
Table table = fromItems[i].getTable();
int columnIndex = table.getColumnIndex(columnName);
if (columnIndex >= 0) {
Column column = table.getColumn(columnName);
return new IdExpr(fromItems[i], column);
}
}
Expr expr = bindParent(tableName, columnName);
if (expr != null) {
return expr;
}
throw new SQLException(L.l("`{0}' is an unknown column.", columnName));
}
else {
for (int i = 0; i < fromItems.length; i++) {
if (tableName.equals(fromItems[i].getName())) {
Table table = fromItems[i].getTable();
if ("resin_oid".equals(columnName))
return new OidExpr(table, i);
int columnIndex = table.getColumnIndex(columnName);
if (columnIndex < 0) {
Expr expr = bindParent(tableName, columnName);
if (expr != null)
return expr;
throw new SQLException(L.l("`{0}' is an unknown column in \n {1}.",
columnName, _sql));
}
Column column = table.getColumn(columnName);
return new IdExpr(fromItems[i], column);
}
}