Search in sources :

Example 11 with TableFieldBeanData

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);
}
Also used : TableBeanHolderFilter(org.eclipse.scout.rt.platform.holders.TableBeanHolderFilter) SqlServiceMock(org.eclipse.scout.rt.server.jdbc.fixture.SqlServiceMock) TableFieldBeanData(org.eclipse.scout.rt.server.jdbc.fixture.TableFieldBeanData) Test(org.junit.Test)

Example 12 with TableFieldBeanData

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);
}
Also used : SqlServiceMock(org.eclipse.scout.rt.server.jdbc.fixture.SqlServiceMock) NVPair(org.eclipse.scout.rt.platform.holders.NVPair) TableFieldBeanData(org.eclipse.scout.rt.server.jdbc.fixture.TableFieldBeanData) Test(org.junit.Test)

Example 13 with TableFieldBeanData

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);
}
Also used : SqlServiceMock(org.eclipse.scout.rt.server.jdbc.fixture.SqlServiceMock) TableFieldBeanData(org.eclipse.scout.rt.server.jdbc.fixture.TableFieldBeanData) Test(org.junit.Test)

Aggregations

TableFieldBeanData (org.eclipse.scout.rt.server.jdbc.fixture.TableFieldBeanData)13 SqlServiceMock (org.eclipse.scout.rt.server.jdbc.fixture.SqlServiceMock)12 Test (org.junit.Test)12 TableBeanHolderFilter (org.eclipse.scout.rt.platform.holders.TableBeanHolderFilter)4 NVPair (org.eclipse.scout.rt.platform.holders.NVPair)3 ContainerBean (org.eclipse.scout.rt.server.jdbc.fixture.ContainerBean)3