本文整理汇总了C++中MojDbQuery::distinct方法的典型用法代码示例。如果您正苦于以下问题:C++ MojDbQuery::distinct方法的具体用法?C++ MojDbQuery::distinct怎么用?C++ MojDbQuery::distinct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MojDbQuery
的用法示例。
在下文中一共展示了MojDbQuery::distinct方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initQuery
MojErr MojDbDistinctTest::initQuery(MojDbQuery& query, const MojChar* queryString)
{
query.clear();
MojErr err = query.from(_T("DistinctTest:1"));
MojTestErrCheck(err);
err = query.distinct(queryString);
MojTestErrCheck(err);
err = query.order(queryString);
MojTestErrCheck(err);
return MojErrNone;
}
示例2: init
MojErr MojDbSearchCursor::init(const MojDbQuery& query)
{
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();
}
m_query.limit(MaxResults);
err = m_query.order(_T(""));
MojErrCheck(err);
return MojErrNone;
}
示例3: init
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;
}