use of org.eclipse.scout.rt.server.jdbc.fixture.ContainerBean in project scout.rt by eclipse.
the class SelectIntoArrayTest method testSelectIntoTableFieldBeanDataInBean.
/**
* {@link TableFieldBeanData} is from type {@link ITableBeanHolder} (introduced with Luna). TableData is in a bean
* (ContainerBean).
*/
@Test
public void testSelectIntoTableFieldBeanDataInBean() throws Exception {
SqlServiceMock sql = createSqlServiceMock(DATA);
//
ContainerBean bean = new ContainerBean();
bean.setTableFieldBeanData(new TableFieldBeanData());
sql.selectInto("SELECT A,B,C FROM T WHERE D=0 INTO :{tableFieldBeanData.active},:{tableFieldBeanData.state},:{tableFieldBeanData.name}", bean);
assertContainsData(bean.getTableFieldBeanData());
}
use of org.eclipse.scout.rt.server.jdbc.fixture.ContainerBean in project scout.rt by eclipse.
the class SelectInputBindTest method testBatchUpdateFromTableFieldBeanDataInBean.
/**
* {@link TableFieldBeanData} is from type {@link ITableBeanHolder} (introduced with Luna). TableData for batch update
* is in a bean (ContainerBean).
*/
@Test
public void testBatchUpdateFromTableFieldBeanDataInBean() throws Exception {
SqlServiceMock sql = createSqlServiceMock();
TableFieldBeanData tableData = createTableFieldBeanData(false);
ContainerBean bean = new ContainerBean();
bean.setTableFieldBeanData(tableData);
sql.update("UDPATE my_table SET a=:{tableFieldBeanData.active}, s=:{tableFieldBeanData.state} where n=:{tableFieldBeanData.name} ", bean);
assertExpectedProtocol(sql);
}
use of org.eclipse.scout.rt.server.jdbc.fixture.ContainerBean in project scout.rt by eclipse.
the class SelectInputBindTest method testBatchUpdateFromTableBeanHolderFilterInBean.
/**
* {@link TableFieldBeanData} in combination with {@link TableBeanHolderFilter} (introduced with Luna). TableData for
* batch update is in a bean (ContainerBean).
*/
@Test
public void testBatchUpdateFromTableBeanHolderFilterInBean() throws Exception {
SqlServiceMock sql = createSqlServiceMock();
TableFieldBeanData tableData = createTableFieldBeanData(true);
TableBeanHolderFilter filter = new TableBeanHolderFilter(tableData, ITableBeanRowHolder.STATUS_UPDATED);
ContainerBean bean = new ContainerBean();
bean.setTableBeanHolderFilter(filter);
sql.update("UDPATE my_table SET a=:{TableBeanHolderFilter.active}, s=:{TableBeanHolderFilter.state} where n=:{TableBeanHolderFilter.name} ", bean);
assertExpectedProtocol(sql);
}
Aggregations