/**
* Test that nesting Criterions works for equals comparison.
*/
public void testNestedCriterionComparisonEqual() throws TorqueException
{
final Column column2 = new ColumnImpl("myTable2", "myColumn2");
final String value2 = "myValue2";
final Column column3 = new ColumnImpl("myTable3", "myColumn3");
final String value3 = "myValue3";
final Column column4 = new ColumnImpl("myTable4", "myColumn4");
final String value4 = "myValue4";
final Column column5 = new ColumnImpl("myTable5", "myColumn5");
final String value5 = "myValue5";
Criterion crit2 =
new Criterion(column2, value2, Criteria.EQUAL);
Criterion crit3 =
new Criterion(column3, value3, Criteria.EQUAL);
Criterion crit4 =
new Criterion(column4, value4, Criteria.EQUAL);
Criterion crit5 =
new Criterion(column5, value5, Criteria.EQUAL);
crit2.and(crit3).or(crit4.and(crit5));
c.where(crit2);
c.addSelectColumn(new ColumnImpl(null, "myTable2", null, "*"));
String expect =
"SELECT * FROM myTable2, myTable3, myTable4, myTable5 WHERE "
+ "((myTable2.myColumn2=? "
+ "AND myTable3.myColumn3=?) "