class DBBaselineManager extends DBManager<Baseline> implements BaselineManager {

    @Override
    public final FilteredRecordsList<SimpleBaselineBean> getOrderedBaselineListWithoutRecords(
            final String columnToOrder, final boolean ascending,
            final int firstResult, final int maxResults, final String search,
            final Map<String, Boolean> searchableColumns)
            throws BaselineManagerException {

        if (columnToOrder == null) {
            LOGGER.debug("null object argument");
            throw new NullPointerException("object");
        }

        final FilteredRecordsList<SimpleBaselineBean> baselines =
                new FilteredRecordsList<>();
        final SessionFactory factory = getFactory();
        Transaction tx = null;
        Session session = factory.getCurrentSession();
        Long totalResultCount;
        Long filteredResultCount = 0L;
        try {
            tx = session.beginTransaction();
            LOGGER.debug("retrieving baseline list without records");
            // The first query gets the total number of non-archived baselines
            Criteria cr = session.createCriteria(Baseline.class)
                    .add(Restrictions.isNull("archivedTime"))
                    .setProjection(Projections.countDistinct("id"));
            totalResultCount = (Long) cr.uniqueResult();

            // This second query finds the number of non-archived baselines matching the filter
            cr = session.createCriteria(Baseline.class)
                .add(Restrictions.isNull("archivedTime"))
                .setProjection(Projections.countDistinct("id"));

            // Filter using the search terms provided by the user
            Conjunction and = Restrictions.conjunction();
            if (totalResultCount != 0) {
                //Builds the search criteria from all of the searchable columns
                if (searchableColumns != null) {
                    // Search for all words in all searchable columns
                    String[] searchWords = search.split(" ");
                    for (String word : searchWords) {
                        // Every word must be in at least one column
                        Disjunction or = Restrictions.disjunction();
                        for (Entry<String, Boolean> entry : searchableColumns.entrySet()) {
                            if (entry.getValue()) {
                                or.add(ilike(entry.getKey(), word, MatchMode.ANYWHERE));
                            } else {
                                or.add(ilikeCast(entry.getKey(), word));
                            }
                        }
                        and.add(or);
                    }
                }
                cr.add(and);
                filteredResultCount = (Long) cr.uniqueResult();
            }

            if (filteredResultCount != 0) {
                // The third query builds a list from the filters, limits, and sorting options
                cr = session.createCriteria(Baseline.class)
                        .add(Restrictions.isNull("archivedTime"))
                        .add(and)
                        .setProjection(Projections.projectionList()
                            .add(Projections.property("id"), "id")
                            .add(Projections.property("createTime"), "createTime")
                            .add(Projections.property("name"), "name")
                            .add(Projections.property("severity"), "severity")
                            .add(Projections.property("type"), "type"))
                        .setResultTransformer(Transformers.aliasToBean(SimpleBaselineBean.class))
                        .setFirstResult(firstResult)
                        .setMaxResults(maxResults);

                if (ascending) {
                    cr.addOrder(Order.asc(columnToOrder));
                } else {
                    cr.addOrder(Order.desc(columnToOrder));
                }

                // Perform the query and add all baselines to the list
                List list = cr.list();
                for (Object o : list) {
                    if (o instanceof SimpleBaselineBean) {
                        baselines.add((SimpleBaselineBean) o);
                    }

                }
            }

            // Update meta data for the Data Table.
            baselines.setRecordsTotal(totalResultCount);
            baselines.setRecordsFiltered(filteredResultCount);
            tx.commit();
        } catch (HibernateException e) {
            final String msg = "Error getting the SimpleBaselineBean list";
            LOGGER.error(msg, e);
            if (tx != null) {
                LOGGER.debug("rolling back transaction");
                tx.rollback();
            }
            throw e;
        } finally {
            if (session != null && session.isConnected()) {
                session.close();
            }
        }

        return baselines;
    }

    public  DBBaselineManager(final SessionFactory sessionFactory);

}