use of org.eclipse.scout.rt.server.jdbc.fixture.TableFieldBeanData in project scout.rt by eclipse.
the class SelectInputBindTest method testBatchUpdateFromTableFieldBeanData.
/**
* {@link TableFieldBeanData} is from type {@link ITableBeanHolder} (introduced with Luna). Direct batch update.
*/
@Test
public void testBatchUpdateFromTableFieldBeanData() throws Exception {
SqlServiceMock sql = createSqlServiceMock();
TableFieldBeanData tableData = createTableFieldBeanData(false);
sql.update("UDPATE my_table SET a=:{active}, s=:{state} where n=:{name} ", tableData);
assertExpectedProtocol(sql);
}
use of org.eclipse.scout.rt.server.jdbc.fixture.TableFieldBeanData in project scout.rt by eclipse.
the class SelectInputBindTest method testBatchUpdateFromTableBeanHolderFilter.
/**
* {@link TableFieldBeanData} in combination with {@link TableBeanHolderFilter} (introduced with Luna). Direct batch
* update.
*/
@Test
public void testBatchUpdateFromTableBeanHolderFilter() throws Exception {
SqlServiceMock sql = createSqlServiceMock();
TableFieldBeanData tableData = createTableFieldBeanData(true);
TableBeanHolderFilter filter = new TableBeanHolderFilter(tableData, ITableBeanRowHolder.STATUS_UPDATED);
sql.update("UDPATE my_table SET a=:{active}, s=:{state} where n=:{name} ", filter);
assertExpectedProtocol(sql);
}
use of org.eclipse.scout.rt.server.jdbc.fixture.TableFieldBeanData in project scout.rt by eclipse.
the class SelectInputBindTest method createTableFieldBeanData.
private TableFieldBeanData createTableFieldBeanData(boolean withAdditionalRows) {
TableFieldBeanData tableBeanData = new TableFieldBeanData();
if (withAdditionalRows) {
createRow(tableBeanData, ITableBeanRowHolder.STATUS_INSERTED, false, 6, "xxx");
}
createRow(tableBeanData, ITableBeanRowHolder.STATUS_UPDATED, true, 3, "lorem");
if (withAdditionalRows) {
createRow(tableBeanData, ITableBeanRowHolder.STATUS_DELETED, false, 8, "yyy");
}
createRow(tableBeanData, ITableBeanRowHolder.STATUS_UPDATED, false, 6, "ipsum");
if (withAdditionalRows) {
createRow(tableBeanData, ITableBeanRowHolder.STATUS_INSERTED, true, 2, "zzz");
}
return tableBeanData;
}
use of org.eclipse.scout.rt.server.jdbc.fixture.TableFieldBeanData 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.TableFieldBeanData in project scout.rt by eclipse.
the class SelectIntoArrayTest method testSelectIntoTableFieldBeanData.
/**
* {@link TableFieldBeanData} is from type {@link ITableBeanHolder} (introduced with Luna). Direct select.
*/
@Test
public void testSelectIntoTableFieldBeanData() throws Exception {
SqlServiceMock sql = createSqlServiceMock(DATA);
//
TableFieldBeanData tableData = new TableFieldBeanData();
sql.selectInto("SELECT A,B,C FROM T WHERE D=0 INTO :active,:state,:name", tableData);
assertContainsData(tableData);
}
Aggregations