log.debug("Getting items, start index " + request.getItemRangeStart()
+ ", count = " + request.getItemRangeCount() + ", filter = "
+ request.getFilterExpression() + ", order = "
+ request.getOrderExpression());
HSqlListSqlHelper helper = new HSqlListSqlHelper(request);
helper.setColumnMapping("id", "id");
helper.setColumnMapping("name", "name");
helper.setColumnMapping("surname", "surname");
helper.setColumnMapping("phone", "phone");
StringBuffer query = new StringBuffer();
query.append(helper.getDatabaseFields());
query.append(" FROM person");
query.append(helper.getDatabaseFilterWith(" WHERE ", ""));
query.append(helper.getDatabaseOrderWith(" ORDER BY ", ""));
log.debug("SQL Query: " + query);
helper.setSqlQuery(query.toString());
helper.addStatementParams(helper.getDatabaseFilterParams());
helper.addStatementParams(helper.getDatabaseOrderParams());
ListItemsData data;
try {
log.debug("Executing Queries");
helper.setDataSource(this.dataSource);
helper.execute();
data = helper.getListItemsData(PersonMO.class);
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
helper.close();
}
return data;
}