Assert.assertEquals(33, with3.getQueryCollection().get(2).getValue());
}
@Test
public void testSubQuery(){
QueryWithSubquery sub = new QueryWithSubquery();
sub.setName("subQuery1");
sub.setSubQuery(new ObjectSubquery("name1"));
Assert.assertTrue(admin.save(sub));
QueryWithSubquery sub2 = new QueryWithSubquery();
sub2.setName("subQuery2");
sub2.setSubQuery(new ObjectSubquery("subQuery2"));
Assert.assertTrue(admin.save(sub2));
QueryWithSubquery sub3 = new QueryWithSubquery();
sub3.setName("subQuery3");
sub3.setSubQuery(new ObjectSubquery("name3"));
Assert.assertTrue(admin.save(sub3));
QueryWithSubquery sub4 = new QueryWithSubquery();
admin.obtain(sub4).If().For("value", ObjectSubquery.class).closeFor().in("name", QueryWithSubquery.class).find();
Assert.assertEquals("subQuery2", sub4.getName());
Assert.assertEquals("subQuery2", sub4.getSubQuery().getValue());
QueryWithSubquery sub5 = new QueryWithSubquery();
admin.obtain(sub5).If("id").greater(0).and().For("value", ObjectSubquery.class).
closeFor().in("name", QueryWithSubquery.class).find();
Assert.assertEquals("subQuery2", sub5.getName());
Assert.assertEquals("subQuery2", sub5.getSubQuery().getValue());
}