Beispiel #1
0
MojErr MojDbIsamQuery::nextPage(MojDbQuery::Page& pageOut)
{
	if (limitEnforced()) {
		pageOut.key() = m_endKey;
	} else {
		pageOut.clear();
	}
	return MojErrNone;
}
Beispiel #2
0
MojErr MojDbSearchCursor::init(const MojDbQuery& query)
{
    LOG_TRACE("Entering function %s", __FUNCTION__);
    MojErr err = initImpl(query);
    MojErrCheck(err);

    err = retrieveCollation(query);
    MojErrCheck(err);

    // override limit and sort since we need to retrieve everything
    // and sort before re-imposing limit
    m_limit = query.limit();
    m_distinct = query.distinct();
    if (!m_distinct.empty()) {
        m_orderProp = m_distinct;
    } else {
        m_orderProp = query.order();
    }
    // retrieve page info from query.
    MojDbQuery::Page page;
    page = m_query.page();
    if(!page.empty()) {
        MojObject objOut;
        err = page.toObject(objOut);
        MojErrCheck(err);
        m_page.fromObject(objOut);
    }
    m_query.limit(MaxResults);
    err = m_query.order(_T(""));
    MojErrCheck(err);
    // delete page info from query for query plan
    page.clear();
    m_query.page(page);

    return MojErrNone;
}