Package org.araneaframework.backend.list.helper

Examples of org.araneaframework.backend.list.helper.HSqlListSqlHelper


    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;
  }
View Full Code Here

TOP

Related Classes of org.araneaframework.backend.list.helper.HSqlListSqlHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.