Skip to Content
Former Member
May 01, 2017 at 06:34 PM

Hybris returns list of lists from querying database


In my project, whenever we want to pull data across multiple database tables (i.e. using JOIN’s in flexible SQL) we have to call query) to get a list of lists and then convert it into a list of POJO objects. When the size of the result set is large it’s causing performance problems. I’m wondering if we have a different approach to query database. For example something similar to Spring JDBC in which we specify O-R mapping in Mappers before we query database and then directly get a list of POJO objects.


  String query = "QUERY";
  FlexibleSearchQuery fQuery = new FlexibleSearchQuery(query);
  List resultClass = new ArrayList();
  SearchResult result = getFlexibleSearchService().search(fQuery)
  List elements = result.getResult();
  for (Object result: elements) {
    Long invoiceNumber = (Long)((List) result).get(1);
    String orderNumber = (String)((List) result).get(0);