// Read a customer
Command select = das.createCommand("SELECT ID, LASTNAME, ADDRESS FROM CUSTOMER WHERE CUSTOMER.ID = 1");
List resultDescriptorList = new ArrayList();
//as long as columnIndex is correct, order in ArrayList does not matter
ResultDescriptor desc3 = factory.createResultDescriptor();
desc3.setColumnIndex(3);
desc3.setColumnName("ADDRESS");
desc3.setColumnType("commonj.sdo.String");
desc3.setTableName("CUSTOMER");
ResultDescriptor desc1 = factory.createResultDescriptor();
desc1.setColumnIndex(1);
desc1.setColumnName("ID");
desc1.setColumnType("commonj.sdo.Int");
desc1.setTableName("CUSTOMER");
ResultDescriptor desc2 = factory.createResultDescriptor();
desc2.setColumnIndex(2);
desc2.setColumnName("LASTNAME");
desc2.setColumnType("commonj.sdo.String");
desc2.setTableName("CUSTOMER");
resultDescriptorList.add(desc3);
resultDescriptorList.add(desc1);
resultDescriptorList.add(desc2);
select.setResultDescriptors(resultDescriptorList);
DataObject root = select.executeQuery();
assertEquals(1, root.getList("CUSTOMER").size());
//Now use invalid one
resultDescriptorList.clear();
desc3.setColumnIndex(3);
desc3.setColumnName("ADDRESS");
desc3.setColumnType("commonj.sdo.Int");//incompatible type
desc3.setTableName("CUSTOMER");
desc1.setColumnIndex(1);
desc1.setColumnName("ID");
desc1.setColumnType("commonj.sdo.Int");
desc1.setTableName("CUSTOMER");
desc2 = factory.createResultDescriptor();
desc2.setColumnIndex(2);
desc2.setColumnName("LASTNAME");
desc2.setColumnType("commonj.sdo.String");
desc2.setTableName("CUSTOMER");
resultDescriptorList.add(desc3);
resultDescriptorList.add(desc2);
resultDescriptorList.add(desc1);