@Test
public void conditionNestedOr() {
MockQueryBuilder tqb = new MockQueryBuilder();
SelectQuery<Person> oq = new GenericSelectQuery<Person, Object>(tqb, Person.class);
Person pers = oq.target();
QueryCondition cond = oq.or();
QueryCondition and1 = cond.or();
and1.eq(pers.getName(), "mary");
and1.eq(pers.getDog().getName(), "mary");
QueryCondition and2 = cond.or();
and2.eq(pers.getName(), "miry");
and2.eq(pers.getDog().getName(), "miry");
tqb.build();
assertEquals(1, tqb.getConditionsString().size());
assertEquals(" ( ( name EQUALS mary OR dog.name EQUALS mary ) OR ( name EQUALS miry OR dog.name EQUALS miry ) ) ", tqb.getConditionsString().get(0));