public void testReadToMany() throws Exception {
if (getAccessStackAdapter().supportsNullBoolean()) {
ObjectContext context = createDataContext();
// prepare data set...
SQLTemplate insert1 = new SQLTemplate(
Qualified1.class,
"insert into QUALIFIED1 (ID, NAME, DELETED) "
+ "values (#bind($id), #bind($name), #bind($deleted 'BOOLEAN'))");
Map<String, Object> parameters1 = new HashMap<String, Object>();
parameters1.put("id", 1);
parameters1.put("name", "OX1");
parameters1.put("deleted", null);
Map<String, Object> parameters2 = new HashMap<String, Object>();
parameters2.put("id", 2);
parameters2.put("name", "OX2");
parameters2.put("deleted", true);
insert1.setParameters(parameters1, parameters2);
context.performQuery(insert1);
SQLTemplate insert2 = new SQLTemplate(
Qualified2.class,
"insert into QUALIFIED2 (ID, NAME, DELETED, QUALIFIED1_ID) "
+ "values (#bind($id), #bind($name), #bind($deleted 'BOOLEAN'), #bind($q1id))");
Map<String, Object> parameters3 = new HashMap<String, Object>();
parameters3.put("id", 1);
parameters3.put("name", "OY1");
parameters3.put("deleted", null);
parameters3.put("q1id", 1);
Map<String, Object> parameters4 = new HashMap<String, Object>();
parameters4.put("id", 2);
parameters4.put("name", "OY2");
parameters4.put("deleted", true);
parameters4.put("q1id", 1);
Map<String, Object> parameters5 = new HashMap<String, Object>();
parameters5.put("id", 3);
parameters5.put("name", "OY3");
parameters5.put("deleted", null);
parameters5.put("q1id", 2);
Map<String, Object> parameters6 = new HashMap<String, Object>();
parameters6.put("id", 4);
parameters6.put("name", "OY4");
parameters6.put("deleted", true);
parameters6.put("q1id", 2);
insert2.setParameters(parameters3, parameters4, parameters5, parameters6);
context.performQuery(insert2);
SelectQuery rootSelect = new SelectQuery(Qualified1.class);
List<Qualified1> roots = context.performQuery(rootSelect);