Search in sources :

Example 6 with AbstractSqlService

use of org.eclipse.scout.rt.server.jdbc.AbstractSqlService in project scout.rt by eclipse.

the class StatementProcessorTest method testFormData.

@Test
public void testFormData() throws Exception {
    IntegerHolder countConcurrent = new IntegerHolder();
    PersonFormData formData = new PersonFormData();
    formData.getAddressTable().addRow();
    formData.getAddressTable().addRow();
    // 
    AbstractSqlService sqlService = new AbstractSqlService() {
    };
    BeanInstanceUtil.initializeBeanInstance(sqlService);
    StatementProcessor sp = new StatementProcessor(sqlService, "SELECT COUNT(*) " + "FROM PERSON P " + "WHERE NVL(:birthdate,TO_DATE('1.1.3000','dd.mm.yyyy')) >= SYSDATE " + "AND :name like '%Me%' " + "AND :{addressTable.street} like '%Park%' " + "INTO :countConcurrent ", new Object[] { formData, new NVPair("countConcurrent", countConcurrent) });
    sp.simulate();
    String sqlPlainTextDump = sp.createSqlDump(false, true);
    assertFalse(sqlPlainTextDump.contains("UNPARSED"));
}
Also used : IntegerHolder(org.eclipse.scout.rt.platform.holders.IntegerHolder) AbstractSqlService(org.eclipse.scout.rt.server.jdbc.AbstractSqlService) NVPair(org.eclipse.scout.rt.platform.holders.NVPair) Test(org.junit.Test)

Aggregations

AbstractSqlService (org.eclipse.scout.rt.server.jdbc.AbstractSqlService)6 Test (org.junit.Test)4 NVPair (org.eclipse.scout.rt.platform.holders.NVPair)3 ProcessingException (org.eclipse.scout.rt.platform.exception.ProcessingException)2 IntegerHolder (org.eclipse.scout.rt.platform.holders.IntegerHolder)2 ArrayList (java.util.ArrayList)1 IHolder (org.eclipse.scout.rt.platform.holders.IHolder)1 LongHolder (org.eclipse.scout.rt.platform.holders.LongHolder)1 AbstractServerSession (org.eclipse.scout.rt.server.AbstractServerSession)1 TestJdbcServerSession (org.eclipse.scout.rt.server.TestJdbcServerSession)1 IToken (org.eclipse.scout.rt.server.jdbc.parsers.token.IToken)1 ValueInputToken (org.eclipse.scout.rt.server.jdbc.parsers.token.ValueInputToken)1 ValueOutputToken (org.eclipse.scout.rt.server.jdbc.parsers.token.ValueOutputToken)1 LookupCall (org.eclipse.scout.rt.shared.services.lookup.LookupCall)1 RunWithServerSession (org.eclipse.scout.rt.testing.server.runner.RunWithServerSession)1