public void testLargeTree() {
String sql = "select a FROM TABLE as a INNER JOIN a.security as d INNER JOIN a.something as b INNER JOIN b.some as e" +
" INNER JOIN b.two as g INNER JOIN g.two as f INNER JOIN f.try as h" +
" where ( ((a.y>:a and d.y>:a) or (a.z>:a and b.z>:a)) and (b.x>:a and e.y>:a) )" +
" and ( ((f.x>:a and f.y>:a) or (g.x>:a and g.y>:a)) and h.f>:a )";
ExpressionNode newTree = scanner.compileSql(sql, wiring, facade);
String result = ""+newTree;
Assert.assertEquals("((h.f > :a and(innerjoin) ((f.x > :a and f.y > :a) or(innerjoin) (g.x > :a and g.y > :a))) and(innerjoin) (((d.y > :a and(innerjoin) a.y > :a) or (b.z > :a and(innerjoin) a.z > :a)) and (e.y > :a and(innerjoin) b.x > :a)))", result);
}