use of org.eclipse.scout.rt.platform.holders.BeanArrayHolder in project scout.rt by eclipse.
the class SelectIntoArrayTest method testSelectIntoFormDataArray.
@Test
public void testSelectIntoFormDataArray() throws Exception {
SqlServiceMock sql = createSqlServiceMock(DATA);
//
Object[][] expectedData = DATA;
BeanArrayHolder<MyFormData> h = new BeanArrayHolder<SelectIntoArrayTest.MyFormData>(MyFormData.class);
sql.selectInto("SELECT A,B,C FROM T WHERE D=0 INTO :{h.active},:{h.state},:{h.name}", new NVPair("h", h));
MyFormData[] a = h.getBeans();
assertNotNull(a);
assertEquals(4, a.length);
for (int i = 0; i < a.length; i++) {
a[i].assertValues(expectedData[i]);
}
}
use of org.eclipse.scout.rt.platform.holders.BeanArrayHolder in project scout.rt by eclipse.
the class SelectIntoArrayTest method testSelectIntoBeanArray.
@Test
public void testSelectIntoBeanArray() throws Exception {
SqlServiceMock sql = createSqlServiceMock(DATA);
//
BeanArrayHolder<MyBean> h = new BeanArrayHolder<SelectIntoArrayTest.MyBean>(MyBean.class);
sql.selectInto("SELECT A,B,C FROM T WHERE D=0 INTO :{h.active},:{h.state},:{h.name}", new NVPair("h", h));
MyBean[] a = h.getBeans();
assertNotNull(a);
assertEquals(4, a.length);
for (int i = 0; i < a.length; i++) {
a[i].assertValues(DATA[i]);
}
}
Aggregations