use of org.eclipse.scout.rt.server.jdbc.fixture.TableFieldBeanData in project scout.rt by eclipse.
the class SelectInputBindTest method testBatchUpdateFromTableBeanHolderFilterInMap.
/**
* {@link TableFieldBeanData} in combination with {@link TableBeanHolderFilter} (introduced with Luna). TableData for
* batch update is in Map bind.
*/
@Test
public void testBatchUpdateFromTableBeanHolderFilterInMap() throws Exception {
SqlServiceMock sql = createSqlServiceMock();
TableFieldBeanData tableData = createTableFieldBeanData(true);
TableBeanHolderFilter filter = new TableBeanHolderFilter(tableData, ITableBeanRowHolder.STATUS_UPDATED);
Map<String, ?> map = Collections.singletonMap("filter", filter);
sql.update("UDPATE my_table SET a=:{filter.active}, s=:{filter.state} where n=:{filter.name} ", map);
assertExpectedProtocol(sql);
}
use of org.eclipse.scout.rt.server.jdbc.fixture.TableFieldBeanData in project scout.rt by eclipse.
the class SelectIntoArrayTest method testSelectIntoTableFieldBeanDataInNVPair.
/**
* {@link TableFieldBeanData} is from type {@link ITableBeanHolder} (introduced with Luna). TableData is in NVPair
* bind.
*/
@Test
public void testSelectIntoTableFieldBeanDataInNVPair() throws Exception {
SqlServiceMock sql = createSqlServiceMock(DATA);
//
TableFieldBeanData tableData = new TableFieldBeanData();
sql.selectInto("SELECT A,B,C FROM T WHERE D=0 INTO :{table.active},:{table.state},:{table.name}", new NVPair("table", tableData));
assertContainsData(tableData);
}
use of org.eclipse.scout.rt.server.jdbc.fixture.TableFieldBeanData in project scout.rt by eclipse.
the class SelectIntoArrayTest method testSelectIntoTableFieldBeanDataInMap.
/**
* {@link TableFieldBeanData} is from type {@link ITableBeanHolder} (introduced with Luna). TableData is in Map bind.
*/
@Test
public void testSelectIntoTableFieldBeanDataInMap() throws Exception {
SqlServiceMock sql = createSqlServiceMock(DATA);
//
TableFieldBeanData tableData = new TableFieldBeanData();
Map<String, ?> map = Collections.singletonMap("table", tableData);
sql.selectInto("SELECT A,B,C FROM T WHERE D=0 INTO :{table.active},:{table.state},:{table.name}", map);
assertContainsData(tableData);
}
Aggregations