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"));
}
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();
}
Aggregations