Search in sources :

Example 6 with IntegerHolder

use of org.eclipse.scout.rt.platform.holders.IntegerHolder 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)

Example 7 with IntegerHolder

use of org.eclipse.scout.rt.platform.holders.IntegerHolder in project scout.rt by eclipse.

the class AbstractCodeTypeWithGeneric method getCodeIndex.

@Override
public int getCodeIndex(final ICode<CODE_ID> c) {
    final IntegerHolder result = new IntegerHolder(-1);
    ICodeVisitor<ICode<CODE_ID>> v = new ICodeVisitor<ICode<CODE_ID>>() {

        private int m_index = 0;

        @Override
        public boolean visit(ICode<CODE_ID> code, int treeLevel) {
            if (code == c) {
                result.setValue(m_index);
            } else {
                m_index++;
            }
            return result.getValue() < 0;
        }
    };
    visit(v, false);
    return result.getValue();
}
Also used : IntegerHolder(org.eclipse.scout.rt.platform.holders.IntegerHolder)

Aggregations

IntegerHolder (org.eclipse.scout.rt.platform.holders.IntegerHolder)7 Test (org.junit.Test)5 NVPair (org.eclipse.scout.rt.platform.holders.NVPair)3 AbstractSqlService (org.eclipse.scout.rt.server.jdbc.AbstractSqlService)2 IDesktop (org.eclipse.scout.rt.client.ui.desktop.IDesktop)1 AbstractOutlineViewButton (org.eclipse.scout.rt.client.ui.desktop.outline.AbstractOutlineViewButton)1 IOutline (org.eclipse.scout.rt.client.ui.desktop.outline.IOutline)1 ProcessingException (org.eclipse.scout.rt.platform.exception.ProcessingException)1 AbstractServerSession (org.eclipse.scout.rt.server.AbstractServerSession)1 TestJdbcServerSession (org.eclipse.scout.rt.server.TestJdbcServerSession)1 RunWithServerSession (org.eclipse.scout.rt.testing.server.runner.RunWithServerSession)1